<!--岗位职责-->

<!--用户权限说明-->
<!--管理员：代码：1，可以做所有的操作-->
<!---->
<template>
  <div style="margin: 0;padding: 0">
    <el-container>
      <!--页面表头设计-->
      <el-header style="height: 7vh">
        <el-link class="headMain" href="http://10.255.96.48:3404/">俄动力质量管理系统</el-link>
        <span class="center-text">岗位职责管理平台</span>
        <el-popover
            placement="top-start"
            title="用户信息"
            width="200"
            trigger="hover">
          <div style="margin-top: 10px">Name：{{useName}}</div>
          <div style="margin-top: 10px">ID:{{useId}}</div>
          <div style="margin-top: 10px" @click="logOut"><el-link>退出</el-link></div>
          <div class="headMain" slot="reference">{{useName}}</div>
        </el-popover>
      </el-header>
      <el-container>
        <el-aside width="200px" style="overflow-x: auto; overflow-y:scroll;"> <!-- 关键修改1：允许横向滚动 -->
          <el-input
              placeholder="输入关键字进行过滤"
              v-model="filterText"
              style="width: 100%; margin-bottom: 10px;"> <!-- 输入框占满父容器宽度 -->
          </el-input>
          <el-tree
              class="filter-tree"
              :data="departmentTree"
              :props="defaultProps"
              default-expand-all
              @node-click="treeClick"
              :filter-node-method="filterNode"
              ref="tree"
              style="min-width: max-content; display: inline-block; white-space: nowrap;"
          v-if="isTree">
          </el-tree>
        </el-aside>
        <el-container>
          <!--主题设计-->
          <el-main style="height: 79vh;overflow: auto">
            <el-tabs v-model="activeName" @tab-click="handleClick">
              <el-tab-pane :label="$t('positionList')" name="positionList">
                <div style="display: flex; align-items: center;margin-bottom: 10px /* 确保子元素垂直居中，根据需要调整 */">
                  <div style="flex: 1; text-align: left;  font-size: 18px; font-weight: bold; /* 左边的div，占满剩余空间 */">
                    <span  style="margin-left: 20px;color: red;">{{positionName}}</span>
                    <span style="margin-left: 20px;color: red;">{{$t('dailyWorkHours')}}:</span>
                    <span style="margin-left: 10px;color: red;">{{positionTime.total}}min</span>
                    <span style="margin-left: 5px">|</span>
                    <span style="margin-left: 5px;color: red;">{{(positionTime.total/60).toFixed(1)}}H</span>
                    <span style="margin-left: 5px">{{$t('regularOperationManHours')}}：{{positionTime.static}}min</span>
                    <span style="margin-left: 5px">{{$t('taskBasedLaborHours')}}：{{positionTime.trigger}}min</span>
                  </div>
                  <div style="width: 100px; /* 右边的div，宽度固定为100px */">
                    <el-link  @click="editJobItem(2,null)" style="display: block; /* 如果需要el-link占满整个div，则设置此样式 */">{{$t('add')}}</el-link>
                  </div>
                </div>
                <el-table
                    :data="tableData"
                    height="65vh"
                    border
                    style="width: 100%">
                  <el-table-column
                      prop="jobItem"
                      label="工作内容/要求"
                      v-slot:default="scope"
                      header-align="center">
                    <div>
                      <div v-if="languageS==='chinese'">
                        <strong style="color: red;font-size: 14px">工作内容：</strong>
                        <span v-html="scope.row.content.split('|*|')[0]"></span>
                      </div>
                      <div v-else-if="languageS==='english'">
                        <strong style="color: red;font-size: 14px">Job Duties：</strong>
                        <span v-html="scope.row.content.split('|*|')[1]"></span>
                      </div>
                      <div v-else-if="languageS==='russian'">
                        <strong style="color: red;font-size: 14px">Содержание работы：</strong>
                        <span v-html="scope.row.content.split('|*|')[2]"></span>
                      </div>
                    </div>
                    <div>
                      <div v-if="languageS==='chinese'">
                        <strong style="color: red;font-size: 14px">工作要求：</strong>
                        <span v-html="scope.row.requirement.split('|*|')[0]"></span>
                      </div>
                      <div v-else-if="languageS==='english'">
                        <strong style="color: red;font-size: 14px">Job require：</strong>
                        <span v-html="scope.row.requirement.split('|*|')[1]"></span>
                      </div>
                      <div v-else-if="languageS==='russian'">
                        <strong style="color: red;font-size: 14px">Требования к работе：</strong>
                        <span v-html="scope.row.requirement.split('|*|')[2]"></span>
                      </div>
                    </div>
                  </el-table-column>
                  <el-table-column
                      prop="cycle"
                      label="周期"
                  v-slot:default="scope"
                  width="100">
                    <span v-if="scope.row.cycle==='' || scope.row.cycle===null || scope.row.cycle===undefined"></span>
                    <span v-else-if="scope.row.cycle.split('/').length<3">{{scope.row.cycle}}</span>
                    <span v-else-if="languageS==='chinese'" >{{scope.row.cycle.split('/')[0]}}</span>
                    <span v-else-if="languageS==='english'" >{{scope.row.cycle.split('/')[1]}}</span>
                    <span v-else-if="languageS==='russian'" >{{scope.row.cycle.split('/')[2]}}</span>
                  </el-table-column>
                  <el-table-column
                      prop="completion_date"
                      label="完成日期"
                  width="100"
                      :show-overflow-tooltip="true">
                  </el-table-column>
                  <el-table-column
                      prop="category"
                      label="工作类别"
                  v-slot:default="scope"
                  width="100">
                    <span v-if="scope.row.category==='' || scope.row.category===null || scope.row.category===undefined"></span>
                    <span v-else-if="scope.row.category.split('/').length<3">{{scope.row.category}}</span>
                    <span v-else-if="languageS==='chinese'" >{{scope.row.category.split('/')[0]}}</span>
                    <span v-else-if="languageS==='english'" >{{scope.row.category.split('/')[1]}}</span>
                    <span v-else-if="languageS==='russian'" >{{scope.row.category.split('/')[2]}}</span>
                  </el-table-column>
                  <el-table-column
                      prop="working_time"
                      label="工作用时（min）"
                  width="100">
                  </el-table-column>
                  <el-table-column
                      prop="everyday"
                      label="每天用时（min）"
                  width="100">
                  </el-table-column>
                  <el-table-column
                      prop="source"
                      label="工作来源"
                  v-slot:default="scope"
                  width="80"
                  header-align="center">
                    <span v-if="scope.row.source==='' || scope.row.source===null || scope.row.source===undefined"></span>
                    <span v-else-if="scope.row.source.split('/').length<3">{{scope.row.source}}</span>
                    <span v-else-if="languageS==='chinese'" >{{scope.row.source.split('/')[0]}}</span>
                    <span v-else-if="languageS==='english'" >{{scope.row.source.split('/')[1]}}</span>
                    <span v-else-if="languageS==='russian'" >{{scope.row.source.split('/')[2]}}</span>
                  </el-table-column>
                  <el-table-column
                      label="编辑"
                  width="80"
                  v-slot:default="scope">
                    <el-link style="margin-left: 8px;" @click="editJobItem(1,scope)"><i class="el-icon-edit"></i></el-link>
                    <el-link style="margin-left: 8px;" @click="deleteShow('deleteListPostList',scope)"><i class="el-icon-delete"></i></el-link>
                    <el-link style="margin-left: 8px;" @click="editJobItem(3,scope)"><i class="el-icon-sort-down"></i></el-link>
                    <el-link style="margin-left: 8px;" @click="editJobItem(4,scope)"><i class="el-icon-sort-up"></i></el-link>
                  </el-table-column>
                </el-table>
              </el-tab-pane>
              <el-tab-pane :label="$t('businessReport')"  name="businessReport">
                <div>
                  <div style="color: red;font-size: 18px">{{businessName}}</div>
                  <div style="height: 65vh;overflow-y: scroll" >
                    <div>
                      <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px">
                        <!-- 左侧文本 -->
                        <span style="margin-right: auto">管理目标：</span>

                        <!-- 右侧按钮组 -->
                        <div style="display: flex; gap: 10px">
                          <el-link @click="business_target_show">
                            <i class="el-icon-s-tools" style="color: #409EFF"></i>
                          </el-link>
                          <el-popover
                              placement="right"
                              width="300"
                              trigger="click">
                            <el-checkbox-group v-model="checkList">
                              <el-checkbox label="Chinese"></el-checkbox>
                              <el-checkbox label="English"></el-checkbox>
                              <el-checkbox label="Russian"></el-checkbox>
                            </el-checkbox-group>
                            <el-link slot="reference">
                              <i class="el-icon-data-line" style="color: #67C23A"></i>
                            </el-link>
                          </el-popover>

                        </div>
                      </div>
                      <el-descriptions border :column="1">
                        <el-descriptions-item :label="$t('managementObjectives')+':'" >
                          <div v-if="businessReportShow.management_goal==='' || businessReportShow.management_goal===null || businessReportShow.management_goal===undefined"></div>
                          <div v-else-if="businessReportShow.management_goal.split('|*|').length!==3" >{{businessReportShow.management_goal}}</div>
                          <div v-else>
                            <div>
                              <strong v-if="checkList.includes('Chinese')">管理目标</strong>
                              <strong v-if="checkList.includes('English')" style="margin-left: 10px">Management Objectives</strong>
                              <strong v-if="checkList.includes('Russian')" style="margin-left: 10px">Цели управления</strong>
                              <strong v-if="checkList.length>0">:</strong>
                            </div>
                            <div v-if="languageS==='chinese' || checkList.includes('Chinese')" >{{businessReportShow.management_goal.split('|*|')[0]}}</div>
                            <div v-if="languageS==='english'|| checkList.includes('English')" >{{businessReportShow.management_goal.split('|*|')[1]}}</div>
                            <div v-if="languageS==='russian'|| checkList.includes('Russian')" >{{businessReportShow.management_goal.split('|*|')[2]}}</div>
                          </div>
                        </el-descriptions-item>
                        <el-descriptions-item :label="$t('documentRequirements')+':'" >
                          <div
                              v-for="(item) in fileRequireShow"
                              :key="item.id">
                            <div v-if="item.require==='' || item.require===undefined || item.require===null"></div>
                            <div v-else-if="item.require.split('|*|').length!==3" v-html="item.require"></div>
                            <div v-else>
                              <div v-if="languageS==='chinese' || checkList.includes('Chinese')" v-html="item.require.split('|*|')[0]"></div>
                              <div v-if="languageS==='english' || checkList.includes('English')" v-html="item.require.split('|*|')[1]"></div>
                              <div v-if="languageS==='russian' || checkList.includes('Russian')" v-html="item.require.split('|*|')[2]"></div>
                            </div>
                            <el-divider></el-divider>
                          </div>
                        </el-descriptions-item>
                        <el-descriptions-item :label="$t('keyPointsAnalysis')+':'" >
                          <div v-if="businessReportShow.key_analysis==='' || businessReportShow.key_analysis===null || businessReportShow.key_analysis===undefined"></div>
                          <div v-else-if="businessReportShow.key_analysis.split('|*|').length!==3" v-html="businessReportShow.key_analysis"></div>
                          <div v-else>
                            <div v-if="languageS==='chinese'" v-html="businessReportShow.key_analysis.split('|*|')[0]"></div>
                            <div v-if="languageS==='english'" v-html="businessReportShow.key_analysis.split('|*|')[1]"></div>
                            <div v-if="languageS==='russian'" v-html="businessReportShow.key_analysis.split('|*|')[2]"></div>
                          </div>
                        </el-descriptions-item>
                      </el-descriptions>
                    </div>
                    <div style="margin-top: 10px">
                      <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px;background-color: #F8F9FA">
                        <span>{{$t('managementLogic')}}：</span>
                        <el-link v-if="businessReportData.length>0" @click="sub_business_edit_show(1,null)"><i class="el-icon-s-tools"></i></el-link>
                      </div>
                      <!--对于管理逻辑，是要进行循环的-->
                      <div v-for="(item,index) in sub_business_show" :key="index">
                        <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px">
                          <div style="text-align: left">
                            <span style="margin-right: 10px">管理项目：</span>
                            <strong v-if="item.name==='' || item.name===null || item.name===undefined" style="color: red"></strong>
                            <strong v-else-if="item.name.split('|*|').length!==3" style="color: red">
                            {{item}}
                          </strong>
                            <strong v-else-if="languageS==='chinese'" style="color: red">
                            {{item.name.split('|*|')[0]}}
                          </strong>
                            <strong v-else-if="languageS==='english'" style="color: red">
                            {{item.name.split('|*|')[1]}}
                          </strong>
                            <strong v-else-if="languageS==='russian'" style="color: red">
                            {{item.name.split('|*|')[2]}}
                          </strong>
                            <el-link @click="sub_business_edit_show(2,item)"><i class="el-icon-s-tools"></i></el-link>
                          </div>
                        </div>
                        <el-descriptions border :column="1">
                          <el-descriptions-item label="业务目标:" >
                            <div v-if="item.target==='' || item.target===null || item.target===undefined" style="color: red"></div>
                            <div v-else-if="item.target.split('|*|').length!==3" v-html="item">
                            </div>
                            <div v-else>
                              <span v-if="languageS==='chinese' || checkList.includes('Chinese')" v-html="item.target.split('|*|')[0]">
                            </span>
                              <span v-if="languageS==='english' || checkList.includes('English')" v-html="item.target.split('|*|')[1]">
                            </span>
                              <span v-if="languageS==='russian' || checkList.includes('Russian')" v-html="item.target.split('|*|')[2]">
                            </span>
                            </div>
                          </el-descriptions-item>
                          <el-descriptions-item label="业务逻辑:" >
                            <div style="text-align: center">
                              <div v-if="checkList.includes('Chinese')" style="margin-top: 10px"><strong style="color: red">Chinese</strong> </div>
                              <el-image
                                  style="width: 70vw; height: 60vh;margin-top: 10px"
                                  :src="item.logic.chinese"
                                  fit="fill"
                                  v-if="languageS==='chinese' || checkList.includes('Chinese')"></el-image>
                              <div v-if="checkList.includes('English')" style="margin-top: 10px"><strong style="color: red">English</strong></div>
                              <el-image
                                  style="width: 70vw; height: 60vh;margin-top: 10px"
                                  :src="item.logic.english"
                                  fit="fill"
                                  v-if="languageS==='english' || checkList.includes('English')"></el-image>
                              <div v-if="checkList.includes('Russian')" style="margin-top: 10px"><strong style="color: red">Russian</strong></div>
                              <el-image
                                  style="width: 70vw; height: 60vh;margin-top: 10px"
                                  :src="item.logic.russian"
                                  fit="fill"
                                  v-if="languageS==='russian' || checkList.includes('Russian')"></el-image>
                            </div>
                          </el-descriptions-item>
                          <el-descriptions-item label="业务总结:" >
                            <div>
                              <el-table border :data="item.summary">
                                <el-table-column label="工作总结" header-align="center"
                                                 v-slot:default="scope">
                                  <div v-if="scope.row.summary==='' || scope.row.summary===undefined || scope.row.summary===null">
                数据有误，请联系管理员
              </div>
                                  <div v-else-if="scope.row.summary.split('|*|').length!==3" v-html="scope.row.summary">
              </div>
                                  <div>
                                    <div v-if="languageS==='chinese' || checkList.includes('Chinese')" v-html="scope.row.summary.split('|*|')[0]">
              </div>
                                    <div v-if="languageS==='english' || checkList.includes('English')" v-html="scope.row.summary.split('|*|')[1]">
              </div>
                                    <div v-if="languageS==='russian' || checkList.includes('Russian')" v-html="scope.row.summary.split('|*|')[2]">
              </div>
                                  </div>
                                </el-table-column>
                                <el-table-column label="负责人" prop="person" width="70"></el-table-column>
                                <el-table-column label="完成时间" prop="endDate" width="100"></el-table-column>
                                <el-table-column label="数字表" prop="aiTableList" width="70"
                                v-slot:default="scope">
                                  <el-popover
                                      placement="top"
                                      width="210"
                                      trigger="click">
                                    <el-table :data="scope.row.aiTableList">
                                      <el-table-column width="50" property="id" label="序号"></el-table-column>
                                      <el-table-column width="150" property="name" label="文件名称" v-slot:default="scope">
                                        <div @click="opAiTable(scope.row.name)">
                                          <span v-if="scope.row.name==='' || scope.row.name===null || scope.row.name===undefined"></span>
                                          <span v-else-if="scope.row.name.split('|*|').length!==3">{{scope.row}}</span>
                                          <span v-else-if="languageS==='chinese'">{{scope.row.name.split('|*|')[0]}}</span>
                                          <span v-else-if="languageS==='english'">{{scope.row.name.split('|*|')[1]}}</span>
                                          <span v-else-if="languageS==='russian'">{{scope.row.name.split('|*|')[2]}}</span>
                                        </div>
                                      </el-table-column>
                                    </el-table>
                                    <el-link slot="reference">查看</el-link>
                                  </el-popover>
                                </el-table-column>
                              </el-table>
                            </div>
                          </el-descriptions-item>
                        </el-descriptions>
                      </div>
                    </div>
                  </div>
                </div>
              </el-tab-pane>
            </el-tabs>
          </el-main>
          <el-footer>
            <el-button plain size="small" @click="chooseLanguage('chinese')">中  文</el-button>
            <el-button plain size="small" @click="chooseLanguage('russian')">Русский язык</el-button>
            <el-button plain size="small" @click="chooseLanguage('english')">English</el-button>
          </el-footer>
        </el-container>
      </el-container>
    </el-container>

    <!--弹窗放置区-->
    <!--编辑业务List用到的弹窗-->
    <el-dialog
        :title="messageDialog"
        v-if="editVisible"
        :visible.sync="editVisible"
        width="680px"
        :before-close="handleClose"
        center>
      <el-form ref="form" :model="tableDataForm" label-width="90px">
        <el-form-item label="工作内容：">
          <rich-text-translate
              :language-s="languageS"
              :rich-text-translate-data="contentRichTextTranslateData"
              @content-change="contentPointsTranslate"
          />
        </el-form-item>
        <el-form-item label="工作要求">
          <rich-text-translate
              :language-s="languageS"
              :rich-text-translate-data="richTextTranslateData"
              @content-change="pointsTranslate"
          />
        </el-form-item>
        <el-form-item label="工作类别：">
          <el-select v-model="tableDataForm.category" clearable placeholder="请选择" style="margin-right: 100px;width: 150px">
            <el-option
                v-for="item in jobCategoryOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
          <span>工作用时(min)：</span>
          <el-input-number v-model="tableDataForm.working_time" style="width: 150px"></el-input-number>
        </el-form-item>
        <el-form-item label="周期" v-if="tableDataForm.category==='定常业务/Constant business/Регулярные операции'">
          <el-select v-model="tableDataForm.cycle" clearable placeholder="请选择" style="margin-right: 10px;width: 150px">
            <el-option
                v-for="item in cycleOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
          <el-select v-model="completionDate[0]" clearable placeholder="请选择" style="width: 110px;margin-right: 8px"
                     v-if="tableDataForm.cycle==='每周/weekly/Еженедельно'||tableDataForm.cycle==='每两周/every two weeks/Каждые две недели'||tableDataForm.cycle==='每月/monthly/Ежемесячно' || tableDataForm.cycle==='每两月/Every two months/Каждые два месяца'||tableDataForm.cycle==='每季度/quarterly/Ежеквартально'||tableDataForm.cycle==='每半年/biannually/Каждые полгода'||tableDataForm.cycle==='每年/every year/Ежегодно/every year/Ежегодно'">
            <el-option
                v-for="item in completionDateOptions1"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
          <el-select v-model="completionDate[1]" clearable placeholder="请选择" style="width: 110px;margin-right: 8px"
                     v-if="tableDataForm.cycle==='每两周/every two weeks/Каждые две недели'||tableDataForm.cycle==='每两月/Every two months/Каждые два месяца'||tableDataForm.cycle==='每季度/quarterly/Ежеквартально'||tableDataForm.cycle==='每半年/biannually/Каждые полгода'||tableDataForm.cycle==='每年/every year/Ежегодно/every year/Ежегодно'">
            <el-option
                v-for="item in completionDateOptions2"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
          <el-select v-model="completionDate[2]" clearable placeholder="请选择" style="width: 110px;margin-right: 8px"
                     v-if="tableDataForm.cycle==='每半年/biannually/Каждые полгода'">
            <el-option
                v-for="item in completionDateOptions3"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="工作来源：">
          <el-select v-model="tableDataForm.source" clearable placeholder="请选择" style="margin-right: 150px;width: 150px">
            <el-option
                v-for="item in jobSourceOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
    <el-button @click="editVisible = false">取 消</el-button>
    <el-button type="primary" @click="editJobItemOk">确 定</el-button>
  </span>
    </el-dialog>
    <!--编辑业务汇报-业务目标   用到的弹窗-->
    <el-dialog
        :title="messageDialog"
        v-if="business_target_dialog"
        :visible.sync="business_target_dialog"
        width="680px"
        :before-close="handleClose"
        center>
      <el-form ref="form" :model="businessReportFrom" label-width="90px">
        <el-form-item label="业务名称：">
          <el-input v-if="businessReportFrom.business==='' || businessReportFrom.business===undefined || businessReportFrom.business===null" disabled></el-input>
          <el-input v-else-if="businessReportFrom.business.split('|*|').length!==3" v-model="businessReportFrom.business" disabled></el-input>
          <el-input v-else-if="languageS==='chinese'" disabled  v-model="businessReportFrom.business.split('|*|')[0]"></el-input>
          <el-input v-else-if="languageS==='english'" disabled  v-model="businessReportFrom.business.split('|*|')[1]"></el-input>
          <el-input v-else-if="languageS==='russian'" disabled  v-model="businessReportFrom.business.split('|*|')[2]"></el-input>
        </el-form-item>
        <el-form-item label="管理目标：">
          <text-translate
            :language-s="languageS"
            :rich-text-translate-data="businessr_report_goal"
            @content-change="businessr_report_goal_data"></text-translate>
        </el-form-item>
        <el-form-item label="文件要求：">
          <el-table border :data="fileRequireData">
            <el-table-column label="文件要求" header-align="center"
                             show-overflow-tooltip
                             v-slot:default="scope">
              <span v-if="scope.row.require==='' || scope.row.require===undefined || scope.row.require===null">
                数据有误，请联系管理员
              </span>
              <span v-else-if="scope.row.require.split('|*|').length!==3" v-html="scope.row.require">
              </span>
              <span v-else-if="languageS==='chinese'" v-html="scope.row.require.split('|*|')[0]">
              </span>
              <span v-else-if="languageS==='english'" v-html="scope.row.require.split('|*|')[1]">
              </span>
              <span v-else-if="languageS==='russian'" v-html="scope.row.require.split('|*|')[2]">
              </span>
            </el-table-column>
            <el-table-column label="编辑" width="100px" header-align="center" v-slot:default="scope">
              <el-link @click="fileRequireEditShow(1,scope)">
                <i class="el-icon-circle-plus-outline" style="margin-left: 3px"></i>
              </el-link>
              <el-link @click="fileRequireEditShow(2,scope)">
                <i class="el-icon-edit" style="margin-left: 3px"></i>
              </el-link>
              <el-link @click="fileRequireEditShow(3,scope)">
                <i class="el-icon-top" style="margin-left: 3px" ></i>
              </el-link>
              <el-link @click="fileRequireEditShow(4,scope)">
                <i class="el-icon-delete" style="margin-left: 3px"></i>
              </el-link>
            </el-table-column>
          </el-table>
        </el-form-item>
        <el-form-item label="管理要点：">
          <rich-text-translate
          :language-s="languageS"
          :rich-text-translate-data="businessr_key_analysis"
          @content-change="businessr_key_analysis_data"/>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
    <el-button @click="business_target_dialog = false">取 消</el-button>
    <el-button type="primary" @click="businessTargetClickOk">确 定</el-button>
  </span>
    </el-dialog>
    <!--编辑业务汇报-子业务逻辑  用到的弹窗-->
    <el-dialog
        :title="messageDialog"
        v-if="business_sub_business_dialog"
        :visible.sync="business_sub_business_dialog"
        width="680px"
        :before-close="handleClose"
        center>
      <el-form ref="form" :model="sub_business_from" label-width="90px">
        <el-form-item label="项目名称：">
          <text-translate
          :language-s="languageS"
          :rich-text-translate-data="sub_business_name"
          @content-change="sub_business_name_translate"/>
        </el-form-item>
        <el-form-item label="项目目标：">
          <rich-text-translate
              :language-s="languageS"
              :rich-text-translate-data="sub_business_target"
              @content-change="sub_business_target_translate"
              />
        </el-form-item>
        <el-form-item label="业务逻辑：">
          <div style="display: flex; gap: 30px;">
            <div style="text-align: center">
              <span>中文</span>
              <el-upload
                  class="avatar-uploader"
                  action=""
                  :show-file-list="false"
                  :auto-upload="false"
                  :on-change="handleAvatarSuccessChinese"
                  accept="image/jpeg, image/png, image/gif, image/webp">
                <img v-if="bus_logicImage_url_chinese" :src="bus_logicImage_url_chinese" class="avatar">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </div>
            <div style="text-align: center">
              <span>英文</span>
              <el-upload
                  class="avatar-uploader"
                  action=""
                  :show-file-list="false"
                  :auto-upload="false"
                  :on-change="handleAvatarSuccessEnglish"
                  accept="image/jpeg, image/png, image/gif, image/webp">
                <img v-if="bus_logicImage_url_english" :src="bus_logicImage_url_english" class="avatar">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </div>
            <div style="text-align: center">
              <span>俄文</span>
              <el-upload
                  class="avatar-uploader"
                  action=""
                  :show-file-list="false"
                  :auto-upload="false"
                  :on-change="handleAvatarSuccessRussian"
                  accept="image/jpeg, image/png, image/gif, image/webp">
                <img v-if="bus_logicImage_url_russian" :src="bus_logicImage_url_russian" class="avatar">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </div>
          </div>

        </el-form-item>
        <el-form-item label="工作总结：">
          <div style="text-align: right">
            <el-link @click="summaryEditShow(1,null)">
              <i class="el-icon-circle-plus-outline" style="margin-left: 3px"></i>
            </el-link>
          </div>
          <el-table border :data="summaryData">
            <el-table-column label="工作总结" header-align="center"
                             show-overflow-tooltip
                             v-slot:default="scope">
              <span v-if="scope.row.summary==='' || scope.row.summary===undefined || scope.row.summary===null">
                数据有误，请联系管理员
              </span>
              <span v-else-if="scope.row.summary.split('|*|').length!==3" v-html="scope.row.summary">
              </span>
              <span v-else-if="languageS==='chinese'" v-html="scope.row.summary.split('|*|')[0]">
              </span>
              <span v-else-if="languageS==='english'" v-html="scope.row.summary.split('|*|')[1]">
              </span>
              <span v-else-if="languageS==='russian'" v-html="scope.row.summary.split('|*|')[2]">
              </span>
            </el-table-column>
            <el-table-column label="负责人" prop="person" width="70"></el-table-column>
            <el-table-column label="完成时间" prop="endDate" width="100"></el-table-column>
            <el-table-column label="数字表" prop="aiTableList" width="70"></el-table-column>
            <el-table-column label="编辑" width="100px" header-align="center" v-slot:default="scope">
              <el-link @click="summaryEditShow(2,scope)">
                <i class="el-icon-edit" style="margin-left: 3px"></i>
              </el-link>
              <el-link @click="summaryEditShow(3,scope)">
                <i class="el-icon-top" style="margin-left: 3px" ></i>
              </el-link>
              <el-link @click="summaryEditShow(4,scope)">
                <i class="el-icon-delete" style="margin-left: 3px"></i>
              </el-link>
            </el-table-column>
          </el-table>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
    <el-button @click="business_sub_business_dialog = false">取 消</el-button>
    <el-button type="primary" @click="business_sub_business_ok">确 定</el-button>
  </span>
    </el-dialog>
    <!--编辑防错分析表的弹窗-->
    <el-dialog
        :title="messageDialog"
        v-if="poka_yoke_dialog"
        :visible.sync="poka_yoke_dialog"
        width="90vw"
        :before-close="handleClose"
        center>
      <job-description-poka-yoke-identify
      :language-s="languageS"
      :use-id="useId"
      :use-name="useName"></job-description-poka-yoke-identify>
  <span slot="footer" class="dialog-footer">
    <el-button @click="poka_yoke_dialog = false">取 消</el-button>
    <el-button type="primary" @click="poka_yoke_dialog=false">确 定</el-button>
  </span>
    </el-dialog>

    <!--删除的弹窗，通用-->
    <el-dialog
        :title="messageDialog"
        :visible.sync="deleteDialog"
        width="30%"
        :before-close="handleClose"
        center>
      <span>确定要删除本条记录吗？</span>
      <span slot="footer" class="dialog-footer">
    <el-button @click="deleteDialog = false">取 消</el-button>
    <el-button type="primary" @click="deleteClickOk">确 定</el-button>
  </span>
    </el-dialog>
    <!--富文本的一个弹窗-->
    <el-dialog
        :title="messageDialog"
        v-if="abundantTextDialog"
        :visible.sync="abundantTextDialog"
        width="680px"
        :before-close="handleClose"
        center>
          <rich-text-translate
          :language-s="languageS"
          :rich-text-translate-data="fileRequireTranslate"
           @content-change="fileRequireTranslateData"></rich-text-translate>
      <span slot="footer" class="dialog-footer">
    <el-button @click="abundantTextDialog = false">取 消</el-button>
    <el-button type="primary" @click="abundantTextEditOk">确 定</el-button>
  </span>
    </el-dialog>
    <!--编辑子业务中的工作总结：富文本,有负责人、完成时间、表单名称等信息，用在了业务总结上-->
    <el-dialog
        :title="messageDialog"
        v-if="sub_business_text_dialog"
        :visible.sync="sub_business_text_dialog"
        width="680px"
        :before-close="handleClose"
        center>
      <el-form >
        <el-form-item label="业务总结：">
          <rich-text-translate
              :language-s="languageS"
              :rich-text-translate-data="business_summary_data"
              @content-change="business_summary_translate"></rich-text-translate>
        </el-form-item>
        <el-form-item label="负责人：">
          <el-input v-model="summaryFrom.person"></el-input>
        </el-form-item>
        <el-form-item label="完成时间：">
          <el-date-picker
              v-model="summaryFrom.endDate"
              type="date"
              value-format="yyyy-MM-dd"
              format="yyyy-MM-dd"
              placeholder="选择日期"
              style="width: 100%">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="数字表单"></el-form-item>
        <el-form-item label="扫描文件"></el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
    <el-button @click="sub_business_text_dialog = false">取 消</el-button>
    <el-button type="primary" @click="sub_business_summary_ok">确 定</el-button>
  </span>
    </el-dialog>
    <!--抽屉放置区域-->

  </div>
</template>

<script>
import { filepath,} from "@/configUse";
import _ from "lodash";
import {generateUUIDv4, Util_Edit_One_File} from '@/components/utils/useUtils'
import RichTextTranslate from "@/components/utils/richTextTranslate.vue";
import TextTranslate from "@/components/utils/textTranslate.vue";
import JobDescriptionPokaYokeIdentify from "@/components/pagePlugin/jobDescriptionPokaYokeIdentify.vue";

export default {
  name: "jobDescription",
  components: {
    JobDescriptionPokaYokeIdentify,
    TextTranslate,
    RichTextTranslate
  },
  props: {
  },
  data() {
    return {
      //在主页中用到的分页
      activeName: 'positionList',
      //在弹窗中用到的分页:岗位List中的工作内容中用到的忙加载
      position_list_content_loading:false,
      //用户权限相关的变量
      useName:'',//用户名称
      useId:'',//用户编号
      usePower:'',//用户权限
      //记录用户选择的语言
      isTree:true,
      languageS:'chinese',
      //用户选择显示那种语言，是在汇报的时候用到
      checkList:[],

      //树形导航栏用到的变量
      //过滤用到的变量
      filterText: '',
      //导航栏用到的树形结构
      departmentTree:[],
      departmentTreeChinese:[
        {label: '品质技术部',
          children: [
            {label: '部内人员',
              children: [
                {label: '部长'},
                {label: '副部长'},
                {label: '内勤&资料室'}
              ]},
            {
              label:'品质管理科',
              children:[
                {
                  label: '科长'
                },
                {
                  label: '副科长'
                },
                {
                  label: '品检主管（1）'
                },
                {
                  label: '品管主管（2）'
                },
                {
                  label: '品管主管'
                },
                {
                  label: '装配管理员'
                },
                {
                  label: '机加管理员'
                },
                {
                  label: '智能化工程师'
                },
                {
                  label: '数据工程师'
                },
                {
                  label: '体系管理员'
                },
                {
                  label: '内审员'
                },
                {
                  label: '精密测量岗（1）'
                },
                {
                  label: '精密测量岗（2）'
                },
                {
                  label: '精密测量岗（3）'
                },
                {
                  label: '专检（缸体）'
                },
                {
                  label: '专检（缸盖）'
                },
                {
                  label: '装配检验（1）'
                },
                {
                  label: '装配检验（2）'
                },
                {
                  label: '入厂检验'
                },
                {
                  label: '计量专员'
                },
              ]
            },
            {
              label:'品质技术科',
              children:[
                {
                  label: '科长'
                },
                {
                  label: '副科长'
                },
                {
                  label: '设备组主管'
                },
                {
                  label: '产品组主管'
                },
                {
                  label: '工艺组主管'
                },
                {
                  label: '现场技术支持（甲）'
                },
                {
                  label: '现场技术支持（乙）'
                },
                {
                  label: '电器工程师（甲）'
                },
                {
                  label: '电器工程师（乙）'
                },
                {
                  label: '项目工程师'
                },
                {
                  label: '智能化工程师（前端/人机工程）'
                },
                {
                  label: '智能化工程师（后端/人工智能）'
                },
                {
                  label: '装配工艺岗（1）'
                },
                {
                  label: '装配工艺岗（2）'
                },
                {
                  label: '防错管理岗'
                },
                {
                  label: '工装管理岗'
                },
                {
                  label: '清洁度管理岗'
                },
                {
                  label: '市场技术专员（1）'
                },
                {
                  label: '市场技术专员（2）'
                },
                {
                  label: '本地化SQE'
                },
                {
                  label: '胶管外附件技术员'
                },
                {
                  label: '电器件技术员'
                },
                {
                  label: '配气机构技术员'
                },
                {
                  label: '曲柄连杆技术员'
                },
              ]
            },
            {
              label:'市场技术科',
              children:[
                {
                  label: '科长'
                },
                {
                  label: '副科长'
                },
                {
                  label: '本地化SQE'
                },
                {
                  label: '故障分析工程师'
                },
                {
                  label: '售后工程师'
                },
                {
                  label: '调研工程师'
                },
                {
                  label: '服务工程师'
                },
                {
                  label:'整机技术员'
                },
                {
                  label: '配气技术员'
                },
                {
                  label: '附件技术员'
                },
                {
                  label: '机体技术员'
                },
                {
                  label: '装配工艺岗（1）'
                },
                {
                  label: '装配工艺岗（2）'
                },
                {
                  label: '防错管理岗'
                },
                {
                  label: '工装管理岗'
                },
              ]
            },
          ],
        },
      ],
      departmentTreeEnglish:[
        {label: 'Quality and Technology',
          children: [
            {label: 'Personnel  department',
              children: [
                {label: '部长'},
                {label: '副部长'},
                {label: '内勤&资料室'}
              ]},
            {
              label:'品质管理科',
              children:[
                {
                  label: '科长'
                },
                {
                  label: '副科长'
                },
                {
                  label: '品检主管（1）'
                },
                {
                  label: '品管主管（2）'
                },
                {
                  label: '品管主管'
                },
                {
                  label: '装配管理员'
                },
                {
                  label: '机加管理员'
                },
                {
                  label: '智能化工程师'
                },
                {
                  label: '数据工程师'
                },
                {
                  label: '体系管理员'
                },
                {
                  label: '内审员'
                },
                {
                  label: '精密测量岗（1）'
                },
                {
                  label: '精密测量岗（2）'
                },
                {
                  label: '精密测量岗（3）'
                },
                {
                  label: '专检（缸体）'
                },
                {
                  label: '专检（缸盖）'
                },
                {
                  label: 'Assembly Inspector（1）'
                },
                {
                  label: 'Assembly Inspector（2）'
                },
              ]
            },
            {
              label:'品质技术科',
              children:[
                {
                  label: '科长'
                },
                {
                  label: '副科长'
                },
                {
                  label: '设备组主管'
                },
                {
                  label: '产品组主管'
                },
                {
                  label: '工艺组主管'
                },
                {
                  label: '现场技术支持（甲）'
                },
                {
                  label: '现场技术支持（乙）'
                },
                {
                  label: '电器工程师（甲）'
                },
                {
                  label: '电器工程师（乙）'
                },
                {
                  label: '项目工程师'
                },
                {
                  label: '智能化工程师（前端/人机工程）'
                },
                {
                  label: '智能化工程师（后端/人工智能）'
                },
                {
                  label: '装配工艺岗（1）'
                },
                {
                  label: '装配工艺岗（2）'
                },
                {
                  label: '防错管理岗'
                },
                {
                  label: '工装管理岗'
                },
                {
                  label: '清洁度管理岗'
                },
                {
                  label: '市场技术专员（1）'
                },
                {
                  label: '市场技术专员（2）'
                },
                {
                  label: '本地化SQE'
                },
                {
                  label: '胶管外附件技术员'
                },
                {
                  label: '电器件技术员'
                },
                {
                  label: '配气机构技术员'
                },
                {
                  label: '曲柄连杆技术员'
                },
              ]
            },
            {
              label:'市场技术科',
              children:[
                {
                  label: '科长'
                },
                {
                  label: '副科长'
                },
                {
                  label: '本地化SQE'
                },
                {
                  label: '故障分析工程师'
                },
                {
                  label: '售后工程师'
                },
                {
                  label: '调研工程师'
                },
                {
                  label: '服务工程师'
                },
                {
                  label:'整机技术员'
                },
                {
                  label: '配气技术员'
                },
                {
                  label: '附件技术员'
                },
                {
                  label: '机体技术员'
                },
                {
                  label: '装配工艺岗（1）'
                },
                {
                  label: '装配工艺岗（2）'
                },
                {
                  label: '防错管理岗'
                },
                {
                  label: '工装管理岗'
                },
              ]
            },
          ],
        },
      ],
      departmentTreeRussian:[],
      //导航数据的模版
      defaultProps: {
        children: 'children',
        label: 'label'
      },

      //岗位List的大表
      tableData:[
        {
          id: '',                    // id
          create_time: '',            // 创建时间（字符串格式或Date对象）
          update_time: '',            // 更新时间
          creator: '',                // 创建人
          process_status: '',         // 流程状态
          sys_update_user: '',        // 更新人
          sys_audit_user: '',         // 审核人
          sys_audit_time: '',         // 审核时间
          sys_deleted: 0,             // 逻辑删除（0=未删除，1=已删除）
          post_name: '',              // 岗位名称
          content: '',                // 工作内容
          requirement: '',            // 工作要求
          cycle: '',                  // 周期
          completion_date: '',        // 完成日期
          category: '',               // 工作类别
          working_time: 0,            // 工作用时
          everyday: 0,                // 折合每天
          instruction: '',            // 作业指导书
          source: '',                 // 工作来源
          orderId:null                // 顺序ID
        }
      ],
      //编辑表单用到的数据
      tableDataForm: {
        id: '',                    // id
        create_time: '',            // 创建时间（字符串格式或Date对象）
        update_time: '',            // 更新时间
        creator: '',                // 创建人
        process_status: '',         // 流程状态
        sys_update_user: '',        // 更新人
        sys_audit_user: '',         // 审核人
        sys_audit_time: '',         // 审核时间
        sys_deleted: 0,             // 逻辑删除（0=未删除，1=已删除）
        post_name: '',              // 岗位名称
        content: '',                // 工作内容
        requirement: '',            // 工作要求
        cycle: '',                  // 周期
        completion_date: '',        // 完成日期
        category: '',               // 工作类别
        working_time: 0,            // 工作用时
        everyday: 0,                // 折合每天
        instruction: '',            // 作业指导书
        source: '',                 // 工作来源
        orderId:null                // 顺序ID
      },
      //记录用户点击的大表中的数据
      tableDataScope:null,
      //用户的编辑类型变量
      tableDataDoe:0,
      //显示用户选择的岗位名称
      positionName:'',
      //岗位List总计时间
      positionTime:{
        total:0,//总共的时长
        static:0,//定常业务总时长
        trigger:0,//触发业务总时长
      },

      //记录岗位名称的数据
      postListName:[
        {
          id: '',
          create_time: null,          // 创建时间
          update_time: null,          // 更新时间
          creator: '',                // 创建人
          process_status: '',         // 流程状态
          sys_update_user: '',        // 系统更新人
          sys_audit_user: '',         // 系统审核人
          sys_audit_time: null,       // 审核时间
          sys_deleted: 0,             // 删除标记 (0-正常, 1-删除)
          department_name: '',        // 部门名称
          section_name: '',           // 科室名称
          group_name: '',             // 小组名称
          post_name: '',              // 岗位名称
          post_nature: '',            // 岗位性质
          authorized_strength: 0      // 编制人数
        }
      ],

      /*弹窗用到的变量*/
      //弹窗的标题显示
      messageDialog:'提示',
      //编辑和新增岗位List用到的弹窗控制
      editVisible:false,
      //删除按钮用到的弹窗
      deleteVisible:false,
      //删除的弹窗，通用
      deleteDialog:false,
      //记录表单中的完成时间，对应的是completionDate字段下的值
      completionDate:[3],
      //周期的选择器
      cycleOptions:[
          {
        value: '每天/every day/каждый день',
        label: '每天/every day/каждый день'
      },
        {
          value: '每周/weekly/Еженедельно',
          label: '每周/weekly/Еженедельно'
        },
        {
          value: '每两周/every two weeks/Каждые две недели',
          label: '每两周/every two weeks/Каждые две недели'
        },
        {
          value: '每月/monthly/Ежемесячно',
          label: '每月/monthly/Ежемесячно'
        },
        {
          value: '每两月/Every two months/Каждые два месяца',
          label: '每两月/Every two months/Каждые два месяца'
        },
        {
          value: '每季度/quarterly/Ежеквартально',
          label: '每季度/quarterly/Ежеквартально'
        },
        {
          value: '每半年/biannually/Каждые полгода',
          label: '每半年/biannually/Каждые полгода'
        },
        {
          value: '每年/every year/Ежегодно/every year/Ежегодно',
          label: '每年/every year/Ежегодно/every year/Ежегодно'
        },
        {
          value: '每2天/Every two days/Каждые два дня',
          label: '每2天/Every two days/Каждые два дня'
        },
        ],
      //记录不同周期的完成确定日期，对应的是completionDate字段下的值
      completionDateOptions1:[],
      completionDateOptions2:[],
      completionDateOptions3:[],
      //如果周期是每周，弹出的现在项
      weeklyOptions:[
        {
          value: '周一/Monday/Понедельник',
          label: '周一/Monday/Понедельник'
        },
        {
          value: '周二/Tuesday/Вторник',
          label: '周二/Tuesday/Вторник'
        },
        {
          value: '周三/Wednesday/Среда',
          label: '周三/Wednesday/Среда'
        },
        {
          value: '周四/Thursday/Четверг',
          label: '周四/Thursday/Четверг'
        },
        {
          value: '周五/Friday/пятница',
          label: '周五/Friday/пятница'
        },
      ],
      //如果周期是每两周，弹出的选项
      twoWeekOptions:[
        {
          value: '奇数周/Odd numbered weeks/нечетные недели',
          label: '奇数周/Odd numbered weeks/нечетные недели'
        },
        {
          value: '偶数周/Even numbered weeks/Четные недели',
          label: '偶数周/Even numbered weeks/Четные недели'
        },
      ],
      //选择每两月，弹出的选项
      twoMonthOptions:[
        {
          value: '奇数月/Odd numbered Months/нечетные месяцы',
          label: '奇数月/Odd numbered Months/нечетные месяцы'
        },
        {
          value: '偶数月/Even numbered months/Четные месяцы',
          label: '偶数月/Even numbered months/Четные месяцы'
        },
      ],
      //如果周期是每季度，弹出的选项
      quarterOptions:[
        {
          value: '季度第一月/The first month of the quarter/Первый квартал',
          label: '季度第一月/The first month of the quarter/Первый квартал'
        },
        {
          value: '季度第二月/Second month of the quarter/Квартальный февраль',
          label: '季度第二月/Second month of the quarter/Квартальный февраль'
        },
        {
          value: '季度第三月/Third month of the quarter/Квартальный март',
          label: '季度第三月/Third month of the quarter/Квартальный март'
        },
      ],
      //如果需要选择那一天的话，使用这个数据
      everydayOptions:[
        {
          value: '01',
          label: '01'
        },
        {
          value: '02',
          label: '02'
        },
        {
          value: '03',
          label: '03'
        },
        {
          value: '04',
          label: '04'
        },
        {
          value: '05',
          label: '05'
        },
        {
          value: '06',
          label: '06'
        },
        {
          value: '07',
          label: '07'
        },
        {
          value: '08',
          label: '08'
        },
        {
          value: '09',
          label: '09'
        },
        {
          value: '10',
          label: '10'
        },
        {
          value: '11',
          label: '11'
        },
        {
          value: '12',
          label: '12'
        },
        {
          value: '13',
          label: '13'
        },
        {
          value: '14',
          label: '14'
        },
        {
          value: '15',
          label: '15'
        },
        {
          value: '16',
          label: '16'
        },
        {
          value: '17',
          label: '17'
        },
        {
          value: '18',
          label: '18'
        },
        {
          value: '19',
          label: '19'
        },
        {
          value: '20',
          label: '20'
        },
        {
          value: '21',
          label: '21'
        },
        {
          value: '22',
          label: '22'
        },
        {
          value: '23',
          label: '23'
        },
        {
          value: '24',
          label: '24'
        },
        {
          value: '25',
          label: '25'
        },
        {
          value: '26',
          label: '26'
        },
        {
          value: '27',
          label: '27'
        },
      ],
      //需要选择月份的数据
      monthOptions:[
        {
          value: '01月/January/Январь',
          label: '01月/January/Январь'
        },
        {
          value: '02月/February/February',
          label: '02月/February/February'
        },
        {
          value: '03月/March/March',
          label: '03月/March/March'
        },
        {
          value: '04月/Апрель/Апрель',
          label: '04月/Апрель/Апрель'
        },
        {
          value: '05月/May/May',
          label: '05月/May/May'
        },
        {
          value: '06月/June/Июнь',
          label: '06月/June/Июнь'
        },
        {
          value: '07月/July/Июль',
          label: '07月/July/Июль'
        },
        {
          value: '08月/August/Август',
          label: '08月/August/Август'
        },
        {
          value: '09月/September/Сентябрь',
          label: '09月/September/Сентябрь'
        },
        {
          value: '10月/October/Октябрь',
          label: '10月/October/Октябрь'
        },
        {
          value: '11月/November/November',
          label: '11月/November/November'
        },
        {
          value: '12月/December/Декабрь',
          label: '12月/December/Декабрь'
        },
      ],
      //选择日期的奇偶
      dayOptions:[
        {
          value: '奇数日/Odd numbered days/нечетный день',
          label: '偶数日/Even numbered days/Четные дни'
        },
      ],
      //记录是定常业务还是触发执行业务
      jobCategoryOptions:[
        {
          value: '定常业务/Constant business/Регулярные операции',
          label: '定常业务/Constant business/Регулярные операции'
        },
        {
          value: '触发业务/Trigger business/Запуск операции',
          label: '触发业务/Trigger business/Запуск операции'
        },
      ],
      //工作来源的选择项
      jobSourceOptions:[
        {
          value: '体系要求/System requirements/Системные требования',
          label: '体系要求/System requirements/Системные требования'
        },
        {
          value: '部门要求/Departmental requirements/Секторальные требования',
          label: '部门要求/Departmental requirements/Секторальные требования'
        },
      ],

      //用户选择类型的变量
      //记录用户选择的是对工作条目那种操作：1：编辑；2.增加，3.删除；
      jobItemDoe:0,
      //记录用户点击的树形导航信息
      treeNode:null,

      //工作清单的大表
      standardWorkListData:[{
        id:null,//主键
        establishTime:'',//创建时间
        updateTime:'',//修改时间
        deleteSign:1,//删除标记
        editName:'',//编辑人

        //项目名称
        projectName:'',
        //项目描述
        projectDes:'',
        //项目用时
        projectTime:0,
        //项目类别
        projectType:'问题分析',
        //所属岗位
        position:'',
      }],
      //标准工作清单的From表单
      standardWorkListFrom:{
        id:null,//主键
        establishTime:'',//创建时间
        updateTime:'',//修改时间
        deleteSign:1,//删除标记
        editName:'',//编辑人

        //项目名称
        projectName:'',
        //项目描述
        projectDes:'',
        //项目用时
        projectTime:0,
        //项目类别
        projectType:'问题分析',
        //所属岗位
        position:'',
      },
      //标准工作清单的Doe
      standardWorkListDoe:0,
      //课题清单的大表数据
      taskListData: [{
        id:null,//主键
        establishTime:'',//创建时间
        updateTime:'',//修改时间
        deleteSign:1,//删除标记
        editName:'',//编辑人

        taskName: '',        // 课题名称 → 简化为 name
        description: '',        // 课题描述 → 简化为 desc（description缩写）
        startDate: '',       // 开始时间 → 简化为 start（startTime可缩写）
        planEndDate: '',     // 计划完成日期 → 强调计划性，planEnd（plan+end）
        creator: '',     //创建人
        plan: '',        // 工作计划 → 保持原意，直接使用 plan
        manager:'',      // 负责人
        progress: '',    // 工作进展 → 保持原意，直接使用 progress
        userComment: '',     // 留言 → 保持原意，直接使用 comment
        actualEndDate: '',   // 实际完成日期 → 强调实际，actualEnd（actual+end）
        difficulty: '',  // 难易程度 → 保持原意，直接使用 difficulty
        score: 0,       // 得分 → 保持原意，直接使用 score
        feedback: '',     // 评价 → 保持原意，直接使用 feedback
        isFinish:'No'//是否完成
      }],
      //课题清单的From
      taskListFrom:{
        id:null,//主键
        establishTime:'',//创建时间
        updateTime:'',//修改时间
        deleteSign:1,//删除标记
        editName:'',//编辑人

        taskName: '',        // 课题名称 → 简化为 name
        description: '',        // 课题描述 → 简化为 desc（description缩写）
        startDate: '',       // 开始时间 → 简化为 start（startTime可缩写）
        planEndDate: '',     // 计划完成日期 → 强调计划性，planEnd（plan+end）
        creator: '',     //创建人
        creatorId:'',     //创建人工号
        plan: '',        // 工作计划 → 保持原意，直接使用 plan
        manager:'',      // 负责人
        managerId:'',   //负责人工号；
        progress: '',    // 工作进展 → 保持原意，直接使用 progress
        userComment: '',     // 留言 → 保持原意，直接使用 comment
        actualEndDate: '',   // 实际完成日期 → 强调实际，actualEnd（actual+end）
        difficulty: '',  // 难易程度 → 保持原意，直接使用 difficulty
        score: 0,       // 得分 → 保持原意，直接使用 score
        feedback: '',     // 评价 → 保持原意，直接使用 feedback
        isFinish:'No'//是否完成
      },
      //课题清单的Scope
      taskListScope:null,
      //课题清单的Doe
      taskListDoe:0,
      //项目类别选择器
      projectTypeOption:[
        {value:'问题分析/Problem Analysis/Анализ проблем',label: '问题分析/Problem Analysis/Анализ проблем'},
        {value:'组织会议/Organize Meeting/Организация встречи',label: '组织会议/Organize Meeting/Организация встречи'},
        {value:'编制文件/Document Preparation/Подготовка документов',label: '编制文件/Document Preparation/Подготовка документов'},
        {value:'编制方案/Scheme Development/Разработка схемы',label: '编制方案/Scheme Development/Разработка схемы'},
        {value:'质量审核/Quality Audit/Аудит качества',label: '质量审核/Quality Audit/Аудит качества'}
      ],
      //
      isFinishOption:[
        {label: 'Yes',value:'Yes'},
        {label: 'No',value:'No'}
      ],

      //从富文本的弹窗中，返回的富文本接口
      richTranslateRequire:{
        zh:'',
        en:'',
        ru:'',
      },

      //控制标准工作打开的窗口
      standardWorkListFromDialog:false,
      //控制一个富文本的弹窗
      abundantTextDialog:false,
      //富文本状态的控制器
      abundantTextDoe:'',
      //控制一个日期和是否完成
      isFinishDialog:false,
      //控制课题清单编辑的弹窗
      taskListFromDialog:false,

      //工作要求的富文本子组件传递的内容
      richTextTranslateData:{
        'zh':'',
        'en':'',
        'ru':'',
      },
      //工作内容的富文本子组件传递的内容
      contentRichTextTranslateData:{
        'zh':'',
        'en':'',
        'ru':'',
      },

      //临时变量
      //删除的类别
      deleteListDoe:0,
      //第一个文本框
      text1:'',
      //第二个文本框
      text2:'',
      //第三个文本框
      text3:'',
      //第四个文本框
      text4:'',

      //选择器
      //困难程度的选择器
      difficultyOption: [
        {
          value: '简单/Simple/Простой',
          label: '简单/Simple/Простой'
        },
        {
          value: '中等/Medium/Средний',
          label: '中等/Medium/Средний'
        },
        {
          value: '困难/Hard/Сложный',
          label: '困难/Hard/Сложный'
        }
      ],

      //控制编辑业务汇报-管理目标的弹窗
      business_target_dialog:false,
      //控制编辑业务逻辑的弹窗
      business_sub_business_dialog:false,
      //控制防错分析的编辑表
      poka_yoke_dialog:false,
      //科室业务清单名称的变量,从后端调上来的变量
      business_name:[
        {
          id:'',                 // id
          create_time:'',     // 创建时间
          update_time:'',     // 更新时间
          creator:'',            // 创建人
          process_status:'',     // 流程状态
          sys_update_user:'',    // 更新人
          sys_audit_user:'',     // 审核人
          sys_audit_time:'', // 审核时间
          sys_deleted:'',          // 逻辑删除
          department_name:'',    // 部门名称
          section_name:'',       // 科室名称
          business_name:'',     // 业务名称
        }
      ],
      //业务汇报的数据结构大表
      businessReportData:[
        {
          id: '',                     // id
          create_time: '',            // 创建时间（字符串格式或Date对象）
          update_time: '',            // 更新时间
          creator: '',                // 创建人
          process_status: '',         // 流程状态
          sys_update_user: '',        // 更新人
          sys_audit_user: '',         // 审核人
          sys_audit_time: '',         // 审核时间
          sys_deleted: 0,             // 逻辑删除（0=未删除，1=已删除）

          //业务名称
          business:'',
          //管理目标
          management_goal:'',
          //体系要求
          system_require:'',
          //要点分析
          key_analysis:'',
          //子业务1,标记为用50个字符；
          sub_business_1:'',
          sign_sub_business_1:'',
          //子业务2,标记为用50个字符；
          sub_business_2:'',
          sign_sub_business_2:'',
          //子业务3,标记为用50个字符；
          sub_business_3:'',
          sign_sub_business_3:'',
          //子业务4,标记为用50个字符；
          sub_business_4:'',
          sign_sub_business_4:'',
          //子业务5,标记为用50个字符；
          sub_business_5:'',
          sign_sub_business_5:'',
          //子业务6,标记为用50个字符；
          sub_business_6:'',
          sign_sub_business_6:'',
          //子业务7,标记为用50个字符；
          sub_business_7:'',
          sign_sub_business_7:'',
          //子业务8,标记为用50个字符；
          sub_business_8:'',
          sign_sub_business_8:'',
          //子业务9,标记为用50个字符；
          sub_business_9:'',
          sign_sub_business_9:'',
          //子业务10,标记为用50个字符；
          sub_business_10:'',
          sign_sub_business_10:'',
          //子业务11,标记为用50个字符；
          sub_business_11:'',
          sign_sub_business_11:'',
          //子业务12,标记为用50个字符；
          sub_business_12:'',
          sign_sub_business_12:'',
          //子业务13,标记为用50个字符；
          sub_business_13:'',
          sign_sub_business_13:'',
          //子业务14,标记为用50个字符；
          sub_business_14:'',
          sign_sub_business_14:'',
          //子业务15,标记为用50个字符；
          sub_business_15:'',
          sign_sub_business_15:'',
          //业务的唯一标识，部门/科室/业务名称，保存的是英文的
          index_name:'',
        }
      ],
      //大表中显示在页面上的元素
      businessReportShow:{
        id: '',                     // id
        create_time: '',            // 创建时间（字符串格式或Date对象）
        update_time: '',            // 更新时间
        creator: '',                // 创建人
        process_status: '',         // 流程状态
        sys_update_user: '',        // 更新人
        sys_audit_user: '',         // 审核人
        sys_audit_time: '',         // 审核时间
        sys_deleted: 0,             // 逻辑删除（0=未删除，1=已删除）

        //业务名称
        business:'',
        //管理目标
        management_goal:'',
        //体系要求
        system_require:'',
        //要点分析
        key_analysis:'',
        //子业务1,标记为用50个字符；
        sub_business_1:'',
        sign_sub_business_1:'',
        //子业务2,标记为用50个字符；
        sub_business_2:'',
        sign_sub_business_2:'',
        //子业务3,标记为用50个字符；
        sub_business_3:'',
        sign_sub_business_3:'',
        //子业务4,标记为用50个字符；
        sub_business_4:'',
        sign_sub_business_4:'',
        //子业务5,标记为用50个字符；
        sub_business_5:'',
        sign_sub_business_5:'',
        //子业务6,标记为用50个字符；
        sub_business_6:'',
        sign_sub_business_6:'',
        //子业务7,标记为用50个字符；
        sub_business_7:'',
        sign_sub_business_7:'',
        //子业务8,标记为用50个字符；
        sub_business_8:'',
        sign_sub_business_8:'',
        //子业务9,标记为用50个字符；
        sub_business_9:'',
        sign_sub_business_9:'',
        //子业务10,标记为用50个字符；
        sub_business_10:'',
        sign_sub_business_10:'',
        //子业务11,标记为用50个字符；
        sub_business_11:'',
        sign_sub_business_11:'',
        //子业务12,标记为用50个字符；
        sub_business_12:'',
        sign_sub_business_12:'',
        //子业务13,标记为用50个字符；
        sub_business_13:'',
        sign_sub_business_13:'',
        //子业务14,标记为用50个字符；
        sub_business_14:'',
        sign_sub_business_14:'',
        //子业务15,标记为用50个字符；
        sub_business_15:'',
        sign_sub_business_15:'',
        //业务的唯一标识，部门/科室/业务名称，保存的是英文的
        index_name:'',
      },
      businessReportFrom:{
        id: '',                     // id
        create_time: '',            // 创建时间（字符串格式或Date对象）
        update_time: '',            // 更新时间
        creator: '',                // 创建人
        process_status: '',         // 流程状态
        sys_update_user: '',        // 更新人
        sys_audit_user: '',         // 审核人
        sys_audit_time: '',         // 审核时间
        sys_deleted: 0,             // 逻辑删除（0=未删除，1=已删除）

        //业务名称
        business:'',
        //管理目标
        management_goal:'',
        //体系要求
        system_require:'',
        //要点分析
        key_analysis:'',
        //子业务1,标记为用50个字符；
        sub_business_1:'',
        sign_sub_business_1:'',
        //子业务2,标记为用50个字符；
        sub_business_2:'',
        sign_sub_business_2:'',
        //子业务3,标记为用50个字符；
        sub_business_3:'',
        sign_sub_business_3:'',
        //子业务4,标记为用50个字符；
        sub_business_4:'',
        sign_sub_business_4:'',
        //子业务5,标记为用50个字符；
        sub_business_5:'',
        sign_sub_business_5:'',
        //子业务6,标记为用50个字符；
        sub_business_6:'',
        sign_sub_business_6:'',
        //子业务7,标记为用50个字符；
        sub_business_7:'',
        sign_sub_business_7:'',
        //子业务8,标记为用50个字符；
        sub_business_8:'',
        sign_sub_business_8:'',
        //子业务9,标记为用50个字符；
        sub_business_9:'',
        sign_sub_business_9:'',
        //子业务10,标记为用50个字符；
        sub_business_10:'',
        sign_sub_business_10:'',
        //子业务11,标记为用50个字符；
        sub_business_11:'',
        sign_sub_business_11:'',
        //子业务12,标记为用50个字符；
        sub_business_12:'',
        sign_sub_business_12:'',
        //子业务13,标记为用50个字符；
        sub_business_13:'',
        sign_sub_business_13:'',
        //子业务14,标记为用50个字符；
        sub_business_14:'',
        sign_sub_business_14:'',
        //子业务15,标记为用50个字符；
        sub_business_15:'',
        sign_sub_business_15:'',
        //业务的唯一标识，部门/科室/业务名称，保存的是英文的
        index_name:'',
      },
      businessReportDoe:0,
      businessReportScope:null,
      //业务汇报中，文件要求的变量
      fileRequireData:[{
        require:''
      }],
      fileRequireFrom:{require:''},
      fileRequireShow:[{
        id:'',
        require:''
      }],
      fileRequireDoe:0,
      fileRequireScope:null,
      //业务汇报中，子业务需要细分，是一个对象，子业务用’|sub_business|‘分割
      sub_business_data:[{
        //子业务业务名称：普通文本
        name:'',
        //子业务业务目标：富文本
        target:'',
        //业务逻辑：存储的是一个图片的地址
        logic:'',
        //业务总结:可以是多个，每个中间用’|summary|‘分割，内容是富文本
        summary:'',
      }],
      //业务汇报中，用在业务展示上。子业务需要细分，是一个对象，子业务用’|sub_business|‘分割
      sub_business_show:[{
        //子业务业务名称：普通文本
        name:'',
        //子业务业务目标：富文本
        target:'',
        //业务逻辑：存储的是一个图片的地址
        logic:{
          chinese:'',
          english:'',
          russian:'',
        },
        //业务总结:可以是多个，每个中间用’|summary|‘分割，内容是富文本
        summary: [{
          //工作总结
          summary:'',
          //负责人
          person:'',
          //完成时间
          endDate:'',
          //链接的智能表单
          aiTableList:[
            { id:null,
              name:''}
          ],
          //上传的文件
          fileList:[
            { id:null,
              name:''}
          ]
        }],
        //记录存在的字段名称
        saveName:'',
        signName:'',
      }],
      //循环的时候触发不了，那么我单独设置一个变量进行循环
      sub_business_show_length:0,
      //工作总结的子项目,用在了修改、编辑上
      summaryData:[
        {
          //工作总结
          summary:'',
          //负责人
          person:'',
          //完成时间
          endDate:'',
          //链接的智能表单
          aiTableList:[
            { id:null,
              name:''}
          ],
          //上传的文件
          fileList:[
            { id:null,
              name:''}
          ]
        }
      ],
      //工作总结的子项目表单
      summaryFrom:{
        //工作总结
        summary:'',
        //负责人
        person:'',
        //完成时间
        endDate:'',
        //链接的智能表单
        aiTableList:[
          { id:null,
            name:''}
        ],
        //上传的文件
        fileList:[
          { id:null,
            name:''}
        ]
      },
      //工作总结的编辑类型
      summaryDoe:0,
      //工作总结的Scope类型
      summaryScope:null,

      sub_business_doe:0,
      sub_business_scope:null,
      sub_business_from:{
        //子业务业务名称：普通文本
        name:'',
        //子业务业务目标：富文本
        target:'',
        //业务逻辑：存储的是一个图片的地址
        logic:'',
        //业务总结:可以是多个，每个中间用’|summary|‘分割，内容是富文本
        summary:'',
      },
      /**---------------------------------业务相关---------------------------------**/
      //业务管理的Tree，中文
      businessTreeChinese:[
        {label: '产品技术部',
          children: [
            {
              label:'品质技术科',
              children:[
                {
                  label: '防错管理'
                },
              ]
            },
          ],
        },
      ],
      businessTreeEnglish:[
        {label: 'Quality and Technology',
          children: [
            {
              label:'Product Technology',
              children:[
                {
                  label: 'Poka-Yoke'
                },
              ]
            },
          ],
        },
      ],
      businessTreeRussian:[
        {label: 'Технический отдел качества',
          children: [
            {
              label:'ОТП отдел технологии продукции',
              children:[
                {
                  label: 'Poka-Yoke'
                },
              ]
            },
          ],
        },
      ],
      businessName:'',
      //文件要求给子组件传递的产生
      fileRequireTranslate:{
        zh:'',
        en:'',
        ru:'',
      },
      //管理目标给子组件传递的参数,管理目标
      businessr_report_goal:{
        zh:'',
        en:'',
        ru:'',
      },
      //管理目标给子组件传递的参数，管理要点
      businessr_key_analysis:{
        zh:'',
        en:'',
        ru:'',
      },
      //子项目中，传递的项目名称
      sub_business_name:{
        zh:'',
        en:'',
        ru:'',
      },
      //子项目中，传递的项目名称翻译后的结果
      sub_business_name_translate_data:{
        zh:'',
        en:'',
        ru:'',
      },
      //子项目中，传递项目目标数据，富文本
      sub_business_target:{
        zh:'',
        en:'',
        ru:'',
      },
      //子项目中，返回的翻译后的项目目标数据，富文本
      sub_business_target_translate_data:{
        zh:'',
        en:'',
        ru:'',
      },
      //子项目中，编辑业务总结，传递给子组件的翻译变量
      business_summary_data:{
        zh:'',
        en:'',
        ru:'',
      },
      //返回的业务总计翻译变量
      business_summary_translate_data:{
        zh:'',
        en:'',
        ru:'',
      },
      //控制子业务业务总结的弹窗
      sub_business_text_dialog:false,
      //中文的逻辑图片地址、图片文件
      bus_logicImage_url_chinese:null,
      bus_logicImage_file_chinese:null,
      //英文的逻辑图片地址、图片文件
      bus_logicImage_url_english:null,
      bus_logicImage_file_english:null,
      //俄文的逻辑图片地址、图片文件
      bus_logicImage_url_russian:null,
      bus_logicImage_file_russian:null,
    }
  },
  watch: {
    filterText(val) {
      this.$refs.tree.filter(val);
    },
    'tableDataForm.cycle'(newVal) {
      // 当选择发生变化时，执行这个函数
      for (let i = 0; i < 3; i++) {
        this.completionDate[i]=''
      }
      this.tableDataForm.completionDate=''
      if (newVal==='每周/weekly/Еженедельно'){
        this.completionDateOptions1=this.weeklyOptions
      }
      else if (newVal==='每两周/every two weeks/Каждые две недели'){
        this.completionDateOptions1=this.twoWeekOptions
        this.completionDateOptions2=this.weeklyOptions
      }
      else if (newVal==='每月/monthly/Ежемесячно'){
        this.completionDateOptions1=this.everydayOptions
      }
      else if (newVal==='每两月/Every two months/Каждые два месяца'){
        this.completionDateOptions1=this.twoMonthOptions
        this.completionDateOptions2=this.everydayOptions
      }
      else if (newVal==='每季度/quarterly/Ежеквартально'){
        this.completionDateOptions1=this.quarterOptions
        this.completionDateOptions2=this.everydayOptions
      }
      else if (newVal==='每半年/biannually/Каждые полгода'){
        this.completionDateOptions1=this.monthOptions
        this.completionDateOptions2=this.monthOptions
        this.completionDateOptions3=this.everydayOptions
      }
      else if (newVal==='每年/every year/Ежегодно'){
        this.completionDateOptions1=this.monthOptions
        this.completionDateOptions2=this.everydayOptions
      }
      else if (newVal==='每2天/Every two days/Каждые два дня'){
        this.completionDateOptions1=this.dayOptions
      }
    },
  },
  methods: {
    //查询用户信息的函数
    inquiry(){
      //输入用户编号，向后端查询信息
      const useId=localStorage.getItem('userName').replace(/"/g, '');
      this.$request.post('/useQueryPower',{
        queryFiledName:'systemDocument',
        userId:useId,
      }).then(result=>{
        if (result.code === 401) {
          this.$router.push('UserLogin')
          alert("您未登录，请登录")
        }else {
          this.useName=result.data.name
          this.usePower=result.data.systemDocument
          this.useId=useId
        }
      })
    },
    //退出登录
    logOut(){
      localStorage.removeItem('u_token');
      localStorage.removeItem('userName')
      this.$router.push('UserLogin')
    },
    //子组件翻译，翻译的工作要求
    pointsTranslate(val){
      this.tableDataForm.requirement=val.zh+'|*|'+val.en+'|*|'+val.ru
    },
    //子组件翻译，翻译的工作内容
    contentPointsTranslate(val){
      this.tableDataForm.content=val.zh+'|*|'+val.en+'|*|'+val.ru
    },
    //过滤导航栏内容
    filterNode(value, data) {
      if (!value) return true;
      return data.label.indexOf(value) !== -1;
    },
    //主页分页的tab列表切换
    handleClick(tab, event) {
      if (this.activeName==='positionList'){
        //导航栏用到的树形结构
        if (this.languageS==='chinese'){

          this.departmentTree = this.departmentTreeChinese
        }
        else if (this.languageS==='english'){
          this.departmentTree = this.departmentTreeEnglish
        }
        else if (this.languageS==='russian'){
          this.departmentTree = this.departmentTreeRussian
        }
      }
      else if (this.activeName==='businessReport'){
        if (this.languageS==='chinese'){
          this.departmentTree=this.businessTreeChinese
        }
        else if (this.languageS==='english'){
          this.departmentTree=this.businessTreeEnglish
        }
        else if (this.languageS==='russian'){
          this.departmentTree=this.businessTreeRussian
        }
      }
      console.log(tab, event);
    },
    //通用：点击删除弹窗的显示函数
    deleteShow(doe,scope){
      if (doe==='deleteListPostList'){
        this.tableDataForm=_.cloneDeep(scope.row)
        this.tableDataScope=scope
      }
      this.deleteListDoe=doe
      this.deleteDialog=true
    },
    //通用：点击删除弹窗的确定按钮
    deleteClickOk(){
      if (this.deleteListDoe==='deleteListPostList'){
        this.tableDataForm.sys_deleted=1
        //向后端修改数据
        this.editOnePostList(this.tableDataForm).then(data=>{
          if (data==='修改成功'){
            this.deleteDialog=false
            this.tableData.splice(this.tableDataScope.$index,1)
            this.totalTime=this.totalTime-Number(this.tableDataScope.row.everyday)
          }
          else {
            this.$message.error('修改失败，请联系管理员')
          }
        })
      }
      else if (this.deleteListDoe==='fileRequireData'){
        this.fileRequireData.splice(this.fileRequireScope.$index,1)
        this.deleteDialog=false
      }
    },
    //弹窗无意关闭用到的函数
    handleClose(done) {
      this.$confirm('确认关闭？')
          /* eslint-disable-next-line no-unused-vars */
          .then(_ => {
            done();
          })
          /* eslint-disable-next-line no-unused-vars */
          .catch(_ => {});
    },
    //通用，语言切换
    chooseLanguage(val){
      this.languageS=val
      if (this.activeName==='positionList'){
        if (this.languageS==='chinese'){
          this.departmentTree=this.departmentTreeChinese
          this.$i18n.locale ='zh'//修改语言
          localStorage.setItem('app_lang', 'zh') // 外部修改也会触发监听
        }
        else if (this.languageS==='english'){
          this.departmentTree=this.departmentTreeEnglish
          this.$i18n.locale ='en'//修改语言
          localStorage.setItem('app_lang', 'en') // 外部修改也会触发监听
        }
        else if (this.languageS==='russian'){
          this.departmentTree=this.departmentTreeRussian
          this.$i18n.locale ='ru'//修改语言
          localStorage.setItem('app_lang', 'ru') // 外部修改也会触发监听
        }
      }
      if (this.activeName==='businessReport'){
        if (this.languageS==='chinese'){
          this.departmentTree=this.businessTreeChinese
          this.$i18n.locale ='zh'//修改语言
          localStorage.setItem('app_lang', 'zh') // 外部修改也会触发监听
        }
        else if (this.languageS==='english'){
          this.departmentTree=this.businessTreeEnglish
          this.$i18n.locale ='en'//修改语言
          localStorage.setItem('app_lang', 'en') // 外部修改也会触发监听
        }
        else if (this.languageS==='russian'){
          this.departmentTree=this.businessTreeRussian
          this.$i18n.locale ='ru'//修改语言
          localStorage.setItem('app_lang', 'ru') // 外部修改也会触发监听
        }
      }
    },
    //通用：点击一个富文本的弹窗中确定按钮
    abundantTextEditOk(){
      if (this.abundantTextDoe==='编辑文件要求'){
        this.fileRequireFrom.require=this.richTranslateRequire.zh+'|*|'+this.richTranslateRequire.en+'|*|'+this.richTranslateRequire.ru
        //修改表，根据状态:新增的时候
        if (this.fileRequireDoe===1){
          this.fileRequireData.push(this.fileRequireFrom)
        }
        //修改表，根据状态:编辑的时候
        else if (this.fileRequireDoe===2){
          this.fileRequireData.splice(this.fileRequireScope.$index,1,this.fileRequireFrom)
        }
        this.abundantTextDialog=false
      }
    },
    //单击导航的函数
    treeClick(data,node){
      this.treeNode=node
      if (node.level===3){
        //数据清空
        this.positionName=''
        this.tableData=[]
        for (let i = 0; i < 3; i++) {
          this.completionDate[i]=''
        }
        if (this.activeName==='positionList'){
          //形成岗位后端记录的岗位标识
          let positionNameList=this.treeAndPostList()
          if (this.languageS==='chinese'){
            this.isTree=false
            this.positionName=positionNameList.zh.split('/')[2]
            //设置岗位导航的数据
            this.departmentTree=this.departmentTreeChinese
            this.isTree=true
          }
          else if (this.languageS==='english'){
            this.positionName=positionNameList.en.split('/')[2]
            //设置岗位导航的数据
            this.departmentTree=this.departmentTreeEnglish.split('/')[2]
          }
          else if (this.languageS==='russian'){
            this.positionName=positionNameList.ru.split('/')[2]
            //设置岗位导航的数据
            this.departmentTree=this.departmentTreeRussian
          }
          if (positionNameList!==''){
            //向后端查询本岗位下的业务清单
            this.inquiryOneFieldValuePostList('post_name',positionNameList.en).then(data=>{
              this.tableData=data
              //对原来的工时数据进行归零
              this.positionTime.total=0
              this.positionTime.trigger=0
              this.positionTime.static=0
              for (let i = 0; i < this.tableData.length; i++) {
                this.positionTime.total=this.positionTime.total+Number(this.tableData[i].everyday)
                //更新每日工时
                if (this.tableData[i].category==='定常业务/Constant business/Регулярные операции'){
                  this.positionTime.static=this.positionTime.static+this.tableData[i].everyday
                }
                else if (this.tableData[i].category==='触发业务/Trigger business/Запуск операции'){
                  this.positionTime.trigger=this.positionTime.trigger+this.tableData[i].everyday
                }
              }
            })
          }
        }
        if (this.activeName==='businessReport'){
          this.businessName=data.label
            //向后端查询防错管理的业务汇报
          this.businessReportData=[]
            this.inquiryBusinessReportOneFiled('index_name',this.treeAndBusinessList().en).then(data=>{

              if (data.length===1){
                this.businessReportShow=data[0]
                //重新组合页面显示的文件要求变量
                let fileRequest=this.businessReportShow.system_require.split('|system_require|')
                this.fileRequireShow=[]
                for (let i = 0; i < fileRequest.length; i++) {
                  this.fileRequireShow.push({
                    id:i,
                    require: fileRequest[i]
                  })
                }
                //组合业务方法的页面显示文件要求变量
                //1.分析有多少个业务，把每一个记录业务的字段组合出来
                let sign_sub=[]//存储的是判断放在哪个字段中
                for (let i = 1; i < 16; i++) {
                  sign_sub.push('sign_sub_business_'+String(i))
                }
                //循环找里面那个业务逻辑中放了内容
                for (let i = 0; i < sign_sub.length; i++) {
                  //判断已经存储了业务逻辑
                  this.sub_business_data=[]
                  this.sub_business_show=[]
                  if (data[0][sign_sub[i]]==='OK'){
                    //组合到业务逻辑中的变量,同时组合好编辑变量、显示变量
                    let filedName='sub_business_'+String(i+1)
                    //组合编辑变量
                    this.sub_business_data.push({
                      name: data[0][filedName].split('|sub_business|')[0],
                      target:data[0][filedName].split('|sub_business|')[1],
                      logic: data[0][filedName].split('|sub_business|')[2],
                      summary: data[0][filedName].split('|sub_business|')[3]
                    })
                    //组合显示变量，首先组合好summary，业务汇报
                    let summaryList=data[0][filedName].split('|sub_business|')[3].split('|summary|')
                    let summaryRest=[]
                    for (let j = 0; j <summaryList.length ; j++) {
                      let summaryTemp=summaryList[j].split('|%|')

                      //组合aiTableList列表
                      let aiTableListTemp = summaryTemp[3].split('|-|')
                      let aiTableList = []
                      for (let k = 0; k < aiTableListTemp.length; k++) {
                        aiTableList.push({id:k,name:aiTableListTemp[k]})
                      }

                      //组合aiTableList列表
                      let fileListTemp = summaryTemp[4].split('|-|')
                      let fileList = []
                      for (let k = 0; k < aiTableListTemp.length; k++) {
                        fileList.push({id:k,name:fileListTemp[k]})
                      }
                      summaryRest.push({
                        //工作总结
                        summary:summaryTemp[0],
                        //完成时间
                        endDate:summaryTemp[1],
                        //负责人
                        person:summaryTemp[2],
                        //链接的智能表单
                        aiTableList:aiTableList,
                        //上传的文件
                        fileList:fileList,
                      })
                    }
                    setTimeout(() => {
                      let logicTemp={
                        chinese:this.businessReportData[0][filedName].split('|sub_business|')[2].split('|*|')[0],
                        english:this.businessReportData[0][filedName].split('|sub_business|')[2].split('|*|')[1],
                        russian:this.businessReportData[0][filedName].split('|sub_business|')[2].split('|*|')[2],
                      }
                      if (logicTemp.chinese!=='' && logicTemp.chinese!==null && logicTemp.chinese!==undefined){
                        logicTemp.chinese=filepath+logicTemp.chinese
                      }
                      if (logicTemp.english!=='' && logicTemp.english!==null && logicTemp.english!==undefined){
                        logicTemp.english=filepath+logicTemp.english
                      }
                      if (logicTemp.russian!=='' && logicTemp.russian!==null && logicTemp.russian!==undefined){
                        logicTemp.russian=filepath+logicTemp.russian
                      }
                      this.sub_business_show.push({
                        name: this.businessReportData[0][filedName].split('|sub_business|')[0],
                        target: this.businessReportData[0][filedName].split('|sub_business|')[1],
                        logic:logicTemp,
                        summary: summaryRest,
                        saveName: filedName,
                        signName: sign_sub[i]
                      });
                      this.sub_business_show_length=this.sub_business_show.length
                    }, 500); // 单位：毫秒
                    this.businessReportData=data
                  }
                }
              }
              else if (data.length===0){
                console.log(data)
                this.businessReportShow={
                      id: '',                     // id
                      create_time: '',            // 创建时间（字符串格式或Date对象）
                      update_time: '',            // 更新时间
                      creator: '',                // 创建人
                      process_status: '',         // 流程状态
                      sys_update_user: '',        // 更新人
                      sys_audit_user: '',         // 审核人
                      sys_audit_time: '',         // 审核时间
                      sys_deleted: 0,             // 逻辑删除（0=未删除，1=已删除）

                      //业务名称
                      business:'',
                      //管理目标
                      management_goal:'',
                      //体系要求
                      system_require:'',
                      //要点分析
                      key_analysis:'',
                      //子业务1,标记为用50个字符；
                      sub_business_1:'',
                      sign_sub_business_1:'',
                      //子业务2,标记为用50个字符；
                      sub_business_2:'',
                      sign_sub_business_2:'',
                      //子业务3,标记为用50个字符；
                      sub_business_3:'',
                      sign_sub_business_3:'',
                      //子业务4,标记为用50个字符；
                      sub_business_4:'',
                      sign_sub_business_4:'',
                      //子业务5,标记为用50个字符；
                      sub_business_5:'',
                      sign_sub_business_5:'',
                      //子业务6,标记为用50个字符；
                      sub_business_6:'',
                      sign_sub_business_6:'',
                      //子业务7,标记为用50个字符；
                      sub_business_7:'',
                      sign_sub_business_7:'',
                      //子业务8,标记为用50个字符；
                      sub_business_8:'',
                      sign_sub_business_8:'',
                      //子业务9,标记为用50个字符；
                      sub_business_9:'',
                      sign_sub_business_9:'',
                      //子业务10,标记为用50个字符；
                      sub_business_10:'',
                      sign_sub_business_10:'',
                      //子业务11,标记为用50个字符；
                      sub_business_11:'',
                      sign_sub_business_11:'',
                      //子业务12,标记为用50个字符；
                      sub_business_12:'',
                      sign_sub_business_12:'',
                      //子业务13,标记为用50个字符；
                      sub_business_13:'',
                      sign_sub_business_13:'',
                      //子业务14,标记为用50个字符；
                      sub_business_14:'',
                      sign_sub_business_14:'',
                      //子业务15,标记为用50个字符；
                      sub_business_15:'',
                      sign_sub_business_15:'',
                }
                this.fileRequireShow=[]
                this.sub_business_show=[]
              }
            })
        }
      }
    },
    //编辑、增加工作List条目
    editJobItem(doe,scope){
      this.tableDataScope=scope
      this.tableDataDoe=doe
      if (this.treeNode===null){
        alert("请先选择岗位")
        return;
      }
      if (this.treeNode.label<3){
        alert("请先选择岗位")
        return;
      }
      if (this.positionName===''){
        alert("请先选择岗位")
        return
      }
      //是编辑一个岗位List
      if (doe===1){
        this.messageDialog='您正在编辑岗位List'
        this.tableDataScope=scope
        this.tableDataForm=_.cloneDeep(scope.row)
        //组合变量完成日期的数据
        const temp=scope.row.completion_date.split('-')
        for (let i = 0; i < temp.length; i++) {
          this.$set(this.completionDate, i, temp[i])
        }
        this.editVisible=true
        //对子组件进行赋值:工作要求
        this.richTextTranslateData.zh=this.tableDataForm.requirement.split('|*|')[0]
        this.richTextTranslateData.en=this.tableDataForm.requirement.split('|*|')[1]
        this.richTextTranslateData.ru=this.tableDataForm.requirement.split('|*|')[2]
        //对子组件进行赋值:工作内容
        this.contentRichTextTranslateData.zh=this.tableDataForm.content.split('|*|')[0]
        this.contentRichTextTranslateData.en=this.tableDataForm.content.split('|*|')[1]
        this.contentRichTextTranslateData.ru=this.tableDataForm.content.split('|*|')[2]
      }
      //增加一项岗位List
      else if (doe===2){
        this.messageDialog='您正在新增一项岗位List'
        //数据初始化
        for (let i = 0; i < 2; i++) {
          this.completionDate[i]=''
        }
        this.editVisible=true
        this.tableDataForm= {
          id: '',                    // id
          create_time: '',            // 创建时间（字符串格式或Date对象）
          update_time: '',            // 更新时间
          creator: this.useId,                // 创建人
          process_status: '',         // 流程状态
          sys_update_user: this.useId,        // 更新人
          sys_audit_user: '',         // 审核人
          sys_audit_time: '',         // 审核时间
          sys_deleted: 0,             // 逻辑删除（0=未删除，1=已删除）
          post_name: '',              // 岗位名称
          content: '',                // 工作内容
          requirement: '',            // 工作要求
          cycle: '',                  // 周期
          completion_date: '',        // 完成日期
          category: '',               // 工作类别
          working_time: 0,            // 工作用时
          everyday: 0,                // 折合每天
          instruction: '',            // 作业指导书
          source: ''                  // 工作来源
        }
        this.contentRichTextTranslateData.zh=''
        this.contentRichTextTranslateData.en=''
        this.contentRichTextTranslateData.ru=''

        this.richTextTranslateData.zh=''
        this.richTextTranslateData.en=''
        this.richTextTranslateData.ru=''
      }
      //是向上移动，不再弹窗，在这里完成
      else if (doe===3){
        //判断，如果已经是最后了，就不修改了
        if (scope.$index===this.tableData.length-1){
          this.$message.error('已经为最后一条')
          return;
        }
        else {
          //设立一个变量，记录自己的order，然后和上一个交换order
          let oldOrder=_.cloneDeep(scope.row.orderId)
          scope.row.orderId=this.tableData[scope.$index+1].orderId
          //向后端发送请求，修改数据
          this.editOnePostList(scope.row).then(()=>{
            //修改下一行的数据
            this.tableData[scope.$index+1].orderId=oldOrder
            this.editOnePostList(this.tableData[scope.$index+1]).then(()=>{
              //修改成功，前端交换数据
              const temp = this.tableData[scope.$index];
              this.tableData[scope.$index] = this.tableData[scope.$index + 1];
              this.tableData[scope.$index + 1] = temp;
              // 如果需要响应式更新（Vue 2），可能需要 this.$set 或重新赋值
              this.tableData = [...this.tableData]; // 触发 Vue 响应式更新
              this.$message.success('下移成功')
            })
          })
        }
      }
      else if (doe===4){
        //判断，如果已经是最后了，就不修改了
        if (scope.$index===0){
          this.$message.error('已经为第一条')
          return;
        }
        else {
          //设立一个变量，记录自己的order，然后和上一个交换order
          let oldOrder=_.cloneDeep(scope.row.orderId)
          scope.row.orderId=this.tableData[scope.$index-1].orderId
          //向后端发送请求，修改数据
          this.editOnePostList(scope.row).then(()=>{
            //修改下一行的数据
            this.tableData[scope.$index-1].orderId=oldOrder
            this.editOnePostList(this.tableData[scope.$index-1]).then(()=>{
              //修改成功，前端交换数据
              const temp = this.tableData[scope.$index];
              this.tableData[scope.$index] = this.tableData[scope.$index - 1];
              this.tableData[scope.$index - 1] = temp;
              // 如果需要响应式更新（Vue 2），可能需要 this.$set 或重新赋值
              this.tableData = [...this.tableData]; // 触发 Vue 响应式更新
              this.$message.success('上移成功')
            })
          })
        }
      }
    },
    //单击增加/修改工作项目的弹窗中“确定”按钮
    editJobItemOk(){
      if (this.tableDataForm.category==='' || this.tableDataForm.category===undefined || this.tableDataForm.category===null){
        this.$message.error('请选择工作类型')
        return;
      }

      //组合频次等相关信息（周期是直接关联的）、组合完成时间、组合折算每天
      if (this.tableDataForm.category==='触发业务/Trigger business/Запуск операции'){
        this.tableDataForm.everyday=this.tableDataForm.working_time
        this.tableDataForm.cycle=''
        this.tableDataForm.completion_date=''
      }
      else if (this.tableDataForm.category==='定常业务/Constant business/Регулярные операции'){
        if (this.tableDataForm.cycle==='每周/weekly/Еженедельно'){
          if (String(this.completionDate[0]) ==='' || this.completionDate[0]===undefined || this.completionDate[0]===null){
            this.$message.error('缺少完成信息')
            return
          }
          this.tableDataForm.completion_date=this.completionDate[0]
          this.tableDataForm.everyday=Math.round(Number(this.tableDataForm.working_time)/5)
        }
        else if (this.tableDataForm.cycle==='每两周/every two weeks/Каждые две недели'){
          if (String(this.completionDate[0]) ==='' || this.completionDate[0]===undefined || this.completionDate[0]===null){
            this.$message.error('缺少完成信息')
            return
          }
          if (String(this.completionDate[1]) ==='' || this.completionDate[1]===undefined || this.completionDate[1]===null){
            this.$message.error('缺少完成信息')
            return
          }

          this.tableDataForm.completion_date=this.completionDate[0]+'-'+this.completionDate[1]
          this.tableDataForm.everyday=Math.round(Number(this.tableDataForm.working_time)/10)
        }
        else if (this.tableDataForm.cycle==='每月/monthly/Ежемесячно'){
          if (String(this.completionDate[0]) ==='' || this.completionDate[0]===undefined || this.completionDate[0]===null){
            this.$message.error('缺少完成信息')
            return
          }
          this.tableDataForm.completion_date=this.completionDate[0]
          this.tableDataForm.everyday=Math.round(Number(this.tableDataForm.working_time)/22)
        }
        else if (this.tableDataForm.cycle==='每两月/Every two months/Каждые два месяца'){
          if (String(this.completionDate[0]) ==='' || this.completionDate[0]===undefined || this.completionDate[0]===null){
            this.$message.error('缺少完成信息')
            return
          }
          if (String(this.completionDate[1]) ==='' || this.completionDate[1]===undefined || this.completionDate[1]===null){
            this.$message.error('缺少完成信息')
            return
          }
          this.tableDataForm.completion_date=this.completionDate[0]+'-'+this.completionDate[1]
          this.tableDataForm.everyday=Math.round(Number(this.tableDataForm.working_time)/44)
        }
        else if (this.tableDataForm.cycle==='每季度/quarterly/Ежеквартально'){
          if (String(this.completionDate[0]) ==='' || this.completionDate[0]===undefined || this.completionDate[0]===null){
            this.$message.error('缺少完成信息')
            return
          }
          if (String(this.completionDate[1]) ==='' || this.completionDate[1]===undefined || this.completionDate[1]===null){
            this.$message.error('缺少完成信息')
            return
          }

          this.tableDataForm.completion_date=this.completionDate[0]+'-'+this.completionDate[1]
          this.tableDataForm.everyday=Math.round(Number(this.tableDataForm.working_time)/66)
        }
        else if (this.tableDataForm.cycle==='每半年/biannually/Каждые полгода'){

          if (String(this.completionDate[0]) ==='' || this.completionDate[0]===undefined || this.completionDate[0]===null){
            this.$message.error('缺少完成信息')
            return
          }
          if (String(this.completionDate[1]) ==='' || this.completionDate[1]===undefined || this.completionDate[1]===null){
            this.$message.error('缺少完成信息')
            return
          }
          if (String(this.completionDate[2]) ==='' || this.completionDate[2]===undefined || this.completionDate[2]===null){
            this.$message.error('缺少完成信息')
            return
          }

          this.tableDataForm.completion_date=this.completionDate[0]+'-'+this.completionDate[1]+'-'+this.completionDate[2]
          this.tableDataForm.everyday=Math.round(Number(this.tableDataForm.working_time)/122)
        }
        else if (this.tableDataForm.cycle==='每年/every year/Ежегодно/every year/Ежегодно'){

          if (String(this.completionDate[0]) ==='' || this.completionDate[0]===undefined || this.completionDate[0]===null){
            this.$message.error('缺少完成信息')
            return
          }
          if (String(this.completionDate[1]) ==='' || this.completionDate[1]===undefined || this.completionDate[1]===null){
            this.$message.error('缺少完成信息')
            return
          }
          this.tableDataForm.completion_date=this.completionDate[0]+'-'+this.completionDate[1]
          this.tableDataForm.everyday=Math.round(Number(this.tableDataForm.working_time)/244)
        }
        else if (this.tableDataForm.cycle==='每2天/Every two days/Каждые два дня'){
          this.tableDataForm.completion_date="每2天/Every two days/Каждые два дня"
          this.tableDataForm.everyday=Math.round(Number(this.tableDataForm.working_time)/2)
        }
        else if (this.tableDataForm.cycle==='每天/every day/каждый день'){
          this.tableDataForm.completion_date="每天/every day/каждый день"
          this.tableDataForm.everyday=Math.round(Number(this.tableDataForm.working_time))
        }

      }
      //是插入一条岗位List
      if (this.tableDataDoe===2){
        //组合UUID
        this.tableDataForm.id=generateUUIDv4()
        //组合岗位部门
        this.tableDataForm.post_name=this.treeAndPostList().en
        //组合顺序id
        this.tableDataForm.orderId=this.tableData.length+1

        //向后端发送请求,插入一行数据
        this.$request.post('/insertPostListJobDescription',this.tableDataForm).then(result=>{
          if (result.code===401){
            this.$router.push('UserLogin')
            alert("您未登录，请登录")
          }
          //如果成功接收到数据，在控制台打印数据并提示插入成功
          else{
            this.$message.success('插入成功')
            this.tableData.push(this.tableDataForm)
            //更新每日工时
            //对原来的工时数据进行归零
            this.positionTime.total=0
            this.positionTime.trigger=0
            this.positionTime.static=0
            for (let i = 0; i < this.tableData.length; i++) {
              this.positionTime.total=this.positionTime.total+Number(this.tableData[i].everyday)
              //更新每日工时
              if (this.tableData[i].category==='定常业务/Constant business/Регулярные операции'){
                this.positionTime.static=this.positionTime.static+this.tableData[i].everyday
              }
              else if (this.tableData[i].category==='触发业务/Trigger business/Запуск операции'){
                this.positionTime.trigger=this.positionTime.trigger+this.tableData[i].everyday
              }
            }
            this.editVisible=false
          }
        })
      }
      //是编辑一条岗位List
      if (this.tableDataDoe===1){
        this.editOnePostList(this.tableDataForm).then(data=>{
          if (data==='修改成功'){
            this.$message.success('修改成功')
            this.tableData.splice(this.tableDataScope.$index,1,this.tableDataForm)
            //更新每日工时
            //对原来的工时数据进行归零
            this.positionTime.total=0
            this.positionTime.trigger=0
            this.positionTime.static=0
            for (let i = 0; i < this.tableData.length; i++) {
              this.positionTime.total=this.positionTime.total+Number(this.tableData[i].everyday)
              //更新每日工时
              if (this.tableData[i].category==='定常业务/Constant business/Регулярные операции'){
                this.positionTime.static=this.positionTime.static+this.tableData[i].everyday
              }
              else if (this.tableData[i].category==='触发业务/Trigger business/Запуск операции'){
                this.positionTime.trigger=this.positionTime.trigger+this.tableData[i].everyday
              }
            }
            this.editVisible=false
          }
        })
      }
    },
    /*业务汇报相关的函数*/
    //业务汇报中管理目标的弹窗编辑显示函数
    business_target_show(){
      if (this.businessName==='' || this.businessName===undefined || this.businessName===null){
        this.$message.error('未选择业务，请选择业务')
        return
      }
      //编辑按钮，只有编辑一项，如何后端还没有这个项目，将会是插入，如有已经有了，将是修改
      if (this.businessReportData.length===0){
        //后端没有这一项业务，需要新增加
        this.businessReportFrom={
          id: generateUUIDv4(),                     // id
          create_time: '',            // 创建时间（字符串格式或Date对象）
          update_time: '',            // 更新时间
          creator: '',                // 创建人
          process_status: '',         // 流程状态
          sys_update_user: '',        // 更新人
          sys_audit_user: '',         // 审核人
          sys_audit_time: '',         // 审核时间
          sys_deleted: 0,             // 逻辑删除（0=未删除，1=已删除）

          //业务名称
          business:this.treeNode.data.businessName,
          //管理目标
          management_goal:'',
          //体系要求
          system_require:'',
          //要点分析
          key_analysis:'',
          //子业务1,标记为用50个字符；
          sub_business_1:'',
          sign_sub_business_1:'',
          //子业务2,标记为用50个字符；
          sub_business_2:'',
          sign_sub_business_2:'',
          //子业务3,标记为用50个字符；
          sub_business_3:'',
          sign_sub_business_3:'',
          //子业务4,标记为用50个字符；
          sub_business_4:'',
          sign_sub_business_4:'',
          //子业务5,标记为用50个字符；
          sub_business_5:'',
          sign_sub_business_5:'',
          //子业务6,标记为用50个字符；
          sub_business_6:'',
          sign_sub_business_6:'',
          //子业务7,标记为用50个字符；
          sub_business_7:'',
          sign_sub_business_7:'',
          //子业务8,标记为用50个字符；
          sub_business_8:'',
          sign_sub_business_8:'',
          //子业务9,标记为用50个字符；
          sub_business_9:'',
          sign_sub_business_9:'',
          //子业务10,标记为用50个字符；
          sub_business_10:'',
          sign_sub_business_10:'',
          //子业务11,标记为用50个字符；
          sub_business_11:'',
          sign_sub_business_11:'',
          //子业务12,标记为用50个字符；
          sub_business_12:'',
          sign_sub_business_12:'',
          //子业务13,标记为用50个字符；
          sub_business_13:'',
          sign_sub_business_13:'',
          //子业务14,标记为用50个字符；
          sub_business_14:'',
          sign_sub_business_14:'',
          //子业务15,标记为用50个字符；
          sub_business_15:'',
          sign_sub_business_15:'',
          //业务的唯一标识，部门/科室/业务名称，保存的是英文的
          index_name:this.treeAndBusinessList().en,
        }

        //整理业务要求的内容是一个空的
        this.fileRequireData=[]
        this.fileRequireData.push({require: '请输入|*|Please enter|*|Введите, пожалуйста'})
        this.business_target_dialog=true
      }
      //有内容了，需要的是修改了
      else if (this.businessReportData.length===1){
        //表单赋值
        this.businessReportFrom=_.cloneDeep(this.businessReportData[0])
        //文件要求数据组合
        this.fileRequireData=[]
        let fileRequireData=this.businessReportFrom.system_require.split('|system_require|')
        for (let i = 0; i < fileRequireData.length; i++) {
          this.fileRequireData.push({require: fileRequireData[i]})
        }

        //管理目标数据组合
        this.businessr_report_goal.zh=this.businessReportFrom.management_goal.split('|*|')[0]
        this.businessr_report_goal.en=this.businessReportFrom.management_goal.split('|*|')[1]
        this.businessr_report_goal.ru=this.businessReportFrom.management_goal.split('|*|')[2]
        //组合管理要点
        this.businessr_key_analysis.zh=this.businessReportFrom.key_analysis.split('|*|')[0]
        this.businessr_key_analysis.en=this.businessReportFrom.key_analysis.split('|*|')[1]
        this.businessr_key_analysis.ru=this.businessReportFrom.key_analysis.split('|*|')[2]
        this.business_target_dialog=true
      }
      else if (this.businessReportData.length>1){
        this.$message.error('数据有误，请联系管理员')
      }
    },
    //编辑文件要求的辅助函数
    fileRequireEditShow(doe,scope){
      this.fileRequireScope=scope
      this.fileRequireFrom=_.cloneDeep(scope.row)
      this.fileRequireDoe=doe
      //新增一条
      if (doe===1){
        //内容赋值为空
        this.fileRequireTranslate={
          zh:'',
          en:'',
          ru:'',
        }
        this.messageDialog='正在增加一项文件要求'
        this.abundantTextDialog=true
        this.abundantTextDoe='编辑文件要求'
      }
      //是编辑一条信息
      else if (doe===2){
        //内容赋值为空
        this.fileRequireTranslate={
          zh:scope.row.require.split('|*|')[0],
          en:scope.row.require.split('|*|')[1],
          ru:scope.row.require.split('|*|')[2],
        }
        this.messageDialog='正在编辑一项文件要求'
        this.abundantTextDialog=true
        this.abundantTextDoe='编辑文件要求'
      }
      //是向上移动一条信息
      else if (doe===3){
        if (this.fileRequireScope.$index===0){
          this.$message.error('已经是第一条，无法上移')
        }
        else {
          let temp=_.cloneDeep(scope.row)
          //把原来的删除掉
          this.fileRequireData.splice(this.fileRequireScope.$index,1)
          //向它的上一个插入一行
          this.fileRequireData.splice(this.fileRequireScope.$index-1,0,temp)
        }
      }
      //是删除一条信息
      else if (doe===4){
        //调动删除弹窗
        this.deleteListDoe='fileRequireData'
        //设置删除信息
        this.messageDialog='您正在删除一项文件要求'
        this.deleteDialog=true
      }
    },
    //子组件返回数据的函数
    fileRequireTranslateData(val){
      this.richTranslateRequire=val
    },
    //子组件翻译，翻译的管理目标
    businessr_report_goal_data(val){
      this.businessReportFrom.management_goal=val.zh+'|*|'+val.en+'|*|'+val.ru
    },
    //子组件翻译，翻译管理要点
    businessr_key_analysis_data(val){
      this.businessReportFrom.key_analysis=val.zh+'|*|'+val.en+'|*|'+val.ru
    },
    //业务汇报中管理目标的弹窗中的确定按钮
    businessTargetClickOk(){
      // 组合好相应的数据：组合管理目标
      //组合文件要求
      this.businessReportFrom.system_require=''
      for (let i = 0; i < this.fileRequireData.length; i++) {
        if (this.businessReportFrom.system_require==='' || this.businessReportFrom.system_require===undefined || this.businessReportFrom.system_require===null){
          this.businessReportFrom.system_require=this.fileRequireData[i].require
        }
        else {
          this.businessReportFrom.system_require=this.businessReportFrom.system_require+'|system_require|'+this.fileRequireData[i].require
        }
      }
      //如果没有，是插入一条，如果已经有这一项管理名称了，就是修改
      if (this.businessReportData.length===0){
        //再次向后端查询异常，如果没有就进行，如果有，进入修改
        this.inquiryBusinessReportOneFiled('business','防错管理/Poka-Yoke/Poka-Yoke').then(data=>{
          //确认是后端没有
          if (data.length===0){
            //向后端插入一行数据
            this.$request.post('/insertBusinessReportOneJobDescription',this.businessReportFrom).then(result=>{
              if (result.code === 401) {
                this.$router.push('UserLogin')
                alert("您未登录，请登录")
              }
              //如果成功接收到数据
              else {
                this.businessReportData=[]
                this.businessReportData.push(this.businessReportFrom)
                this.businessReportShow=this.businessReportData[0]
                //重新组合页面显示的文件要求变量
                let fileRequest=this.businessReportShow.system_require.split('|system_require|')
                this.fileRequireShow=[]
                for (let i = 0; i < fileRequest.length; i++) {
                  this.fileRequireShow.push({
                    id:i,
                    require: fileRequest[i]
                  })
                }
                this.business_target_dialog=false
              }
            })
          }
          else if (data.length===1){
            this.editBusinessReportOneRow(this.businessReportFrom).then(()=>{
              //修改大表数据
              this.businessReportData=[]
              this.businessReportData.push(this.businessReportFrom)
              this.businessReportShow=this.businessReportData[0]

              //重新组合页面显示的文件要求变量
              let fileRequest=this.businessReportShow.system_require.split('|system_require|')
              this.fileRequireShow=[]
              for (let i = 0; i < fileRequest.length; i++) {
                this.fileRequireShow.push({
                  id:i,
                  require: fileRequest[i]
                })
              }
              this.business_target_dialog=false
            })
          }
          else {
            this.$message.error('数据有误，请联系管理员')
          }
        })
      }
      else if (this.businessReportData.length===1){
        this.editBusinessReportOneRow(this.businessReportFrom).then(()=>{
          //修改大表数据
          this.businessReportData=[]
          this.businessReportData.push(this.businessReportFrom)
          this.businessReportShow=this.businessReportData[0]
          //重新组合页面显示的文件要求变量
          let fileRequest=this.businessReportShow.system_require.split('|system_require|')
          this.fileRequireShow=[]
          for (let i = 0; i < fileRequest.length; i++) {
            this.fileRequireShow.push({
              id:i,
              require: fileRequest[i]
            })
          }
          this.business_target_dialog=false
        })
      }
      else {
        this.$message.error('数据有误，请联系管理员')
      }
    },
    //编辑业务逻辑的显示函数
    sub_business_edit_show(doe,scope){
      if (this.businessName==='' || this.businessName===undefined || this.businessName===null){
        this.$message.error('未选择业务，请选择业务')
        return
      }
      //scope,实际传递的是一行数据，不是插槽的scope数据,是一行业务数据
      this.sub_business_scope=scope
      this.sub_business_doe=doe
      //是新增一个
      if (doe===1){
        //给原始值赋值，大表负责
        this.businessReportFrom=_.cloneDeep(this.businessReportData[0])
        this.sub_business_from={
          //子业务业务名称：普通文本
          name:'',
          //子业务业务目标：富文本
          target:'',
          //业务逻辑：存储的是一个图片的地址
          logic:'',
          //业务总结:可以是多个，每个中间用’|summary|‘分割，内容是富文本
          summary:'',
        }
        this.summaryFrom={
          //工作总结
          summary:'',
          //负责人
          person:'',
          //完成时间
          endDate:'',
          //链接的智能表单
          aiTableList:'',
          //上传的文件
          fileList:''
        }
        this.summaryData=[]
        //文件赋值
        this.bus_logicImage_file_chinese=null
        this.bus_logicImage_file_english=null
        this.bus_logicImage_file_russian=null
        //文件路径赋值
        this.bus_logicImage_url_chinese=''
        this.bus_logicImage_url_english=''
        this.bus_logicImage_url_russian=''
        //初始的业务名称赋值
        this.sub_business_name.zh=''
        this.sub_business_name.en=''
        this.sub_business_name.ru=''
        //初始的逻辑目标赋值
        this.sub_business_target.zh=''
        this.sub_business_target.en=''
        this.sub_business_target.ru=''
        //打开弹窗
        this.business_sub_business_dialog=true
      }
      //是编辑一个业务
      else if (doe===2){
        //给大表的表单赋值
        this.businessReportFrom=_.cloneDeep(this.businessReportData[0])
        //文件路径赋值
        this.bus_logicImage_url_chinese=scope.logic.chinese
        this.bus_logicImage_url_english=scope.logic.english
        this.bus_logicImage_url_russian=scope.logic.russian
        //初始的业务名称赋值(传递子组件）
        this.sub_business_name.zh=scope.name.split('|*|')[0]
        this.sub_business_name.en=scope.name.split('|*|')[1]
        this.sub_business_name.ru=scope.name.split('|*|')[2]
        //初始的业务名称赋值（如果没有修改，将作为组合数据，如果修改，有函数触发修改）
        this.sub_business_name_translate_data.zh=this.sub_business_name.zh
        this.sub_business_name_translate_data.en=this.sub_business_name.en
        this.sub_business_name_translate_data.ru=this.sub_business_name.ru
        //初始的逻辑目标赋值(传递子组件）
        this.sub_business_target.zh=scope.target.split('|*|')[0]
        this.sub_business_target.en=scope.target.split('|*|')[1]
        this.sub_business_target.ru=scope.target.split('|*|')[2]
        //初始的逻辑目标赋值（如果没有修改，将作为组合数据，如果修改，有函数触发修改）
        this.sub_business_target_translate_data.zh=this.sub_business_target.zh
        this.sub_business_target_translate_data.en=this.sub_business_target.en
        this.sub_business_target_translate_data.ru=this.sub_business_target.ru
        //给编辑工作总结的表单进行赋值
        this.summaryData=[]
        this.summaryData=_.cloneDeep(scope.summary)
        //打开弹窗
        this.business_sub_business_dialog=true
      }
    },
    //编辑业务逻辑弹窗中的确定按钮
    business_sub_business_ok(){
      //组合字符串,先组合业务总结子项目
      let summary=''
      //新增、编辑用到的共同代码段，都是数据组合
      for (let i = 0; i < this.summaryData.length; i++) {
        //组合文件列表
        let fileName = ''
        for (let j = 0; j < this.summaryData[i]; j++) {
          if (fileName===''){
            fileName = this.summaryData[i].fileList[j].name
          }
          else {
            fileName = fileName +'|-|' + this.summaryData[i].fileList[j].name
          }
        }
        //智能列表组合
        let aiFileName=''
        for (let j = 0; j < this.summaryData[i]; j++) {
          if (aiFileName===''){
            aiFileName = this.summaryData[i].aiTableList[j].name
          }
          else {
            aiFileName = aiFileName +'|-|' + this.summaryData[i].aiTableList[j].name
          }
        }
        //组合
        if (summary==='' || summary===null || summary===undefined){
          summary=this.summaryData[i].summary+'|%|'+this.summaryData[i].endDate+'|%|'+this.summaryData[i].person+'|%|'+aiFileName+'|%|'+fileName
        }
        else {
          summary=summary+'|summary|'+this.summaryData[i].summary+'|%|'+this.summaryData[i].endDate+'|%|'+this.summaryData[i].person+'|%|'+aiFileName+'|%|'+fileName
        }
      }
      //组合字符串，组合业务名称的字段
      let sub_name=this.sub_business_name_translate_data.zh+'|*|'+this.sub_business_name_translate_data.en+'|*|'+this.sub_business_name_translate_data.ru
      //组合字符串，组合业务目标的字段
      let sub_target=this.sub_business_target_translate_data.zh+'|*|'+this.sub_business_target_translate_data.en+'|*|'+this.sub_business_target_translate_data.ru
      //图片的名称变量
      let imageName={
        chinese:'',
        english:'',
        russian:'',
      }
      //是修改的，需要把原来的文件放进来
      if (this.sub_business_doe===2){
        imageName={
          chinese:this.sub_business_scope.logic.chinese,
          english:this.sub_business_scope.logic.english,
          russian:this.sub_business_scope.logic.russian,
        }
      }
      let logic=''
      //如果用户传了文件，就直接把文件上传了，然后组合好文件名称
      //处理照片，每次打开编辑，都把存在文件的变量设置为null，所以这三个图片默认是没有的，那么就用是否为空来判断。
      if (this.bus_logicImage_file_chinese!==null){
        Util_Edit_One_File(1,this.bus_logicImage_file_chinese.name,this.bus_logicImage_file_chinese.raw,'').then(data=>{
          if (data==='操作成功'){
            this.$message.success('文件保存成功')
          }
          else {
            this.$message.error('文件保存有异常')
          }
        })
      }
      if (this.bus_logicImage_file_english!==null){
        console.log('读取俄文',)
        Util_Edit_One_File(1,this.bus_logicImage_file_english.name,this.bus_logicImage_file_english.raw,'').then(data=>{
          if (data==='操作成功'){
            this.$message.success('文件保存成功')
          }
          else {
            this.$message.error('文件保存有异常')
          }
        })
      }
      if (this.bus_logicImage_file_russian!==null){
        Util_Edit_One_File(1,this.bus_logicImage_file_russian.name,this.bus_logicImage_file_russian.raw,'').then(data=>{
          if (data==='操作成功'){
            this.$message.success('文件保存成功')
          }
          else {
            this.$message.error('文件保存有异常')
          }
        })
      }
      // 处理完毕图片后，无论图片是否正常，都进行文件名称保存
      if (this.bus_logicImage_file_chinese!==null){
        imageName.chinese=this.bus_logicImage_file_chinese.name
      }
      if (this.bus_logicImage_file_english!==null){
        imageName.english=this.bus_logicImage_file_english.name
      }
      if (this.bus_logicImage_file_russian!==null){
        imageName.russian=this.bus_logicImage_file_russian.name
      }
      logic=imageName.chinese+'|*|'+imageName.english+'|*|'+imageName.russian
      //组合这一个业务总结的字段内容
      let sub_business=sub_name+'|sub_business|'+sub_target+'|sub_business|'+logic+'|sub_business|'+summary

      //是新增一条业务逻辑数据(新增和编辑都不处理图片，图片是单独的编辑接口）
      if (this.sub_business_doe===1){
        //判断要把这一项业务放在那个字段中
        let sign_sub=[]//存储的是判断放在哪个字段中
        for (let i = 1; i < 16; i++) {
          sign_sub.push('sign_sub_business_'+String(i))
        }
        //开始判断哪一个是空的
        let filedName=''
        let signFiledName=''
        for (let i = 0; i < sign_sub.length; i++) {
          if (this.businessReportData[0][sign_sub[i]]==='' || this.businessReportData[0][sign_sub[i]]===null || this.businessReportData[0][sign_sub[i]]===undefined){
            filedName='sub_business_'+String(i+1)
            signFiledName=sign_sub[i]
            break
          }
        }
        //把这项业务组合到新表中
        this.businessReportFrom[filedName]=sub_business
        this.businessReportFrom[signFiledName]='OK'
      }
      //是编辑一条数据
      if (this.sub_business_doe===2){
        //把编辑好的内容，赋值到对应的字段中
        this.businessReportFrom[this.sub_business_scope.saveName]=sub_business
      }
      //向后端写入数据
      this.editBusinessReportOneRow(this.businessReportFrom).then(()=>{
        this.businessReportData.splice(0,this.businessReportData.length)
        this.businessReportData.push(this.businessReportFrom)
        //给页面上的值进行赋值
        this.businessReportData.splice(0,this.businessReportData.length)
        this.businessReportData.push(this.businessReportFrom)

        //组合业务方法的页面显示文件要求变量
        //1.分析有多少个业务，把每一个记录业务的字段组合出来
        let sign_sub=[]//存储的是判断放在哪个字段中
        for (let i = 1; i < 16; i++) {
          sign_sub.push('sign_sub_business_'+String(i))
        }
        //循环找里面那个业务逻辑中放了内容
        for (let i = 0; i < sign_sub.length; i++) {
          //判断已经存储了业务逻辑
          this.sub_business_data=[]
          this.sub_business_show=[]
          if (this.businessReportData[0][sign_sub[i]]==='OK'){
            //组合到业务逻辑中的变量,同时组合好编辑变量、显示变量
            let filedName='sub_business_'+String(i+1)
            //组合编辑变量
            this.sub_business_data.push({
              name: this.businessReportData[0][filedName].split('|sub_business|')[0],
              target:this.businessReportData[0][filedName].split('|sub_business|')[1],
              logic: this.businessReportData[0][filedName].split('|sub_business|')[2],
              summary: this.businessReportData[0][filedName].split('|sub_business|')[3]
            })
            //组合显示变量，首先组合好summary，业务汇报
            let summaryList=this.businessReportData[0][filedName].split('|sub_business|')[3].split('|summary|')
            let summaryRest=[]
            for (let j = 0; j <summaryList.length ; j++) {
              let summaryTemp=summaryList[j].split('|%|')

              //组合aiTableList列表
              let aiTableListTemp = summaryTemp[3].split('|-|')
              let aiTableList = []
              for (let k = 0; k < aiTableListTemp.length; k++) {
                aiTableList.push({id:k,name:aiTableListTemp[k]})
              }

              //组合aiTableList列表
              let fileListTemp = summaryTemp[4].split('|-|')
              let fileList = []
              for (let k = 0; k < aiTableListTemp.length; k++) {
                fileList.push({id:k,name:fileListTemp[k]})
              }
              summaryRest.push({
                //工作总结
                summary:summaryTemp[0],
                //完成时间
                endDate:summaryTemp[1],
                //负责人
                person:summaryTemp[2],
                //链接的智能表单
                aiTableList:aiTableList,
                //上传的文件
                fileList:fileList,
              })
            }
            setTimeout(() => {
              let logicTemp={
                chinese:this.businessReportData[0][filedName].split('|sub_business|')[2].split('|*|')[0],
                english:this.businessReportData[0][filedName].split('|sub_business|')[2].split('|*|')[1],
                russian:this.businessReportData[0][filedName].split('|sub_business|')[2].split('|*|')[2],
              }
              if (logicTemp.chinese!=='' && logicTemp.chinese!==null && logicTemp.chinese!==undefined){
                logicTemp.chinese=filepath+logicTemp.chinese
              }
              if (logicTemp.english!=='' && logicTemp.english!==null && logicTemp.english!==undefined){
                logicTemp.english=filepath+logicTemp.english
              }
              if (logicTemp.russian!=='' && logicTemp.russian!==null && logicTemp.russian!==undefined){
                logicTemp.russian=filepath+logicTemp.russian
              }
              this.sub_business_show.push({
                name: this.businessReportData[0][filedName].split('|sub_business|')[0],
                target: this.businessReportData[0][filedName].split('|sub_business|')[1],
                logic:logicTemp,
                summary: summaryRest,
                saveName: filedName,
                signName: sign_sub[i]
              });
              this.sub_business_show_length=this.sub_business_show.length
            }, 500); // 单位：毫秒
          }
        }
      })
    },
    //子项目业务逻辑中,编辑业务总结的显示函数
    summaryEditShow(doe,scope){
      this.summaryDoe=doe
      this.summaryScope=scope
      //当是增加一条业务总结的时候
      if (doe===1){
        this.summaryFrom={
          //工作总结
          summary:'',
          //负责人
          person:'',
          //完成时间
          endDate:'',
          //链接的智能表单
          aiTableList:[],
          //上传的文件
          fileList:[]
        }
        //给富文本的业务总结赋值
        this.business_summary_data.zh=''
        this.business_summary_data.en=''
        this.business_summary_data.ru=''
        this.sub_business_text_dialog=true
      }
      // 是编辑
      else if (doe===2){
        this.summaryFrom=_.cloneDeep(scope.row)
        //切割开智能表
        if (this.summaryFrom.aiTableList==='' || this.summaryFrom.aiTableList===null || this.summaryFrom.aiTableList===undefined){
          this.summaryFrom.aiTableList=[]
        }
        else {
          this.summaryFrom.aiTableList=this.summaryFrom.aiTableList.split('|*|')
        }
        //切割开普通的文件列表
        if (this.summaryFrom.fileList==='' || this.summaryFrom.fileList===null || this.summaryFrom.fileList===undefined){
          this.summaryFrom.fileList=[]
        }
        else {
          this.summaryFrom.fileList=this.summaryFrom.fileList.split('|*|')
        }
        //给富文本的业务总结赋值
        this.business_summary_data.zh=scope.row.summary.split('|*|')[0]
        this.business_summary_data.en=scope.row.summary.split('|*|')[1]
        this.business_summary_data.ru=scope.row.summary.split('|*|')[2]

        this.sub_business_text_dialog=true
      }
      // 是编辑上移一条
      else if (doe===3){
        if (scope.$index===0){
          this.$message.error('已经为第一条，无法上移')
        }
        else {
          this.summaryData.splice(scope.$index,1)
          this.summaryData.splice(scope.$index-1,0,scope.row)
        }
      }
      // 是删除一条
      else if (doe===4){
        this.deleteListDoe='business_summary'
        this.deleteDialog=true
      }
    },
    //子项目业务总结中，编辑业务总结的弹窗确定按钮
    sub_business_summary_ok(){
      //是增加一条工作总结
      if (this.summaryDoe===1){
        //组合数据
        this.summaryFrom.summary=this.business_summary_translate_data.zh+'|*|'+this.business_summary_translate_data.en+'|*|'+this.business_summary_translate_data.ru
        this.summaryData.push(this.summaryFrom)
        this.sub_business_text_dialog=false
      }
      //是编辑一条工作总结
      else if (this.summaryDoe===2){
        //组合数据
        this.summaryFrom.summary=this.business_summary_translate_data.zh+'|*|'+this.business_summary_translate_data.en+'|*|'+this.business_summary_translate_data.ru
        this.summaryData.splice(this.summaryScope.$index,1,this.summaryFrom)
        this.sub_business_text_dialog=false
      }

    },
    //子项目业务逻辑中的业务目标翻译返回的函数
    sub_business_target_translate(val){
      this.sub_business_target_translate_data.zh=val.zh
      this.sub_business_target_translate_data.en=val.en
      this.sub_business_target_translate_data.ru=val.ru
      console.log(val)
    },
    //子项目业务逻辑中的业务名称翻译返回的函数
    sub_business_name_translate(val){
      this.sub_business_name_translate_data.zh=val.zh
      this.sub_business_name_translate_data.en=val.en
      this.sub_business_name_translate_data.ru=val.ru
    },
    //子项目业务总结，返回翻译结果的函数
    business_summary_translate(val){
      this.business_summary_translate_data.zh=val.zh
      this.business_summary_translate_data.en=val.en
      this.business_summary_translate_data.ru=val.ru
    },
    //上传中文的逻辑图
    handleAvatarSuccessChinese(file) {
      this.bus_logicImage_file_chinese=file
      // 起一个唯一的名字
      this.bus_logicImage_file_chinese.name=generateUUIDv4()+'-'+file.name
      this.bus_logicImage_url_chinese = URL.createObjectURL(file.raw);
    },
    //上传英文的逻辑图
    handleAvatarSuccessEnglish(file) {
      this.bus_logicImage_file_english=file
      // 起一个唯一的名字
      this.bus_logicImage_file_english.name=generateUUIDv4()+'-'+file.name
      this.bus_logicImage_url_english = URL.createObjectURL(file.raw);
    },
    //上传俄文的逻辑图
    handleAvatarSuccessRussian(file) {
      this.bus_logicImage_file_russian=file
      // 起一个唯一的名字
      this.bus_logicImage_file_russian.name=generateUUIDv4()+'-'+file.name
      this.bus_logicImage_url_russian = URL.createObjectURL(file.raw);
    },
    //根据不同的数字表，打开不同的弹窗，传入的参数是表名
    opAiTable(tableName){
      if (tableName==='' || tableName===undefined || tableName===null){
        this.$message('无表名')
      }
      //是防错的表，打开防错表的弹窗
      else if (tableName.includes('防错分析')){
        this.messageDialog='防错分析表'
        //分页查询防错分析的数据
        this.poka_yoke_dialog=true
      }
    },
    //通用：现在上传图片格式
    beforeAvatarUpload(file) {
      // 允许的MIME类型列表
      const allowedTypes = ['image/jpeg', 'image/png', 'image/jpg'];

      // 修正后的类型检查（使用数组includes）
      const isAllowedType = allowedTypes.includes(file.type);

      // 大小检查保持不变
      const isLt2M = file.size / 1024 / 1024 < 2;

      if (!isAllowedType) {
        this.$message.error('只能上传 JPG/PNG 格式的图片!');
      }

      return isAllowedType && isLt2M;
    },
    //在岗位List中，根据一个字段筛选等于某一值的所有数据
    async inquiryOneFieldValuePostList(fieldName,fieldVal){
      return this.$request.post('/inquiryOneFieldValuePostListJobDescription', {
        fieldName: fieldName,
        fieldVal: fieldVal
      }).then(result => {
        if (result.code === 401) {
          this.$router.push('UserLogin')
          alert("您未登录，请登录")
        }
        //如果成功接收到数据
        else {
          return result.data
        }
      })
    },
    //辅助函数：岗位List表中，修改一行数据
    async editOnePostList(val){
      return this.$request.post('editOnePostListJobDescription',val)
          .then(result => {
        if (result.code === 401) {
          this.$router.push('UserLogin')
          alert("您未登录，请登录")
        }
        //如果成功接收到数据
        else {
          return result.data
        }
      })
    },
    //辅助函数：根据点击的树形导航岗位名称部分的内容，返回后端记录的岗位名称，后端岗位名称是全英文的，部门/科室/岗位，中间是用“/”分割
    treeAndPostList(){
      if (this.treeNode.level===3){
        let positionName={
          zh:'',
          en:'',
          ru:'',
        }
        //到岗位名称列表中，找到这一行的内容，拼接为后端岗位Lis中的岗位记录信息
        let positListName = this.postListName.filter(item=>item.department_name===this.treeNode.data.departmentName && item.section_name===this.treeNode.data.sectionName && item.post_name===this.treeNode.data.postName)
        if (positListName.length===1){
          positionName.zh=positListName[0].department_name.split('/')[0]+'/'+positListName[0].section_name.split('/')[0]+'/'+positListName[0].post_name.split('/')[0]
          positionName.en=positListName[0].department_name.split('/')[1]+'/'+positListName[0].section_name.split('/')[1]+'/'+positListName[0].post_name.split('/')[1]
          positionName.ru=positListName[0].department_name.split('/')[2]+'/'+positListName[0].section_name.split('/')[2]+'/'+positListName[0].post_name.split('/')[2]
        }
        return positionName
      }
      else {
        this.$message.error("非岗位层")
        return ''
      }
    },
    //辅助函数：根据点击的树形导航岗位名称部分的内容，返回后端记录的业务汇报名称，后端岗位名称是全英文的，部门/科室/业务汇报，中间是用“/”分割
    treeAndBusinessList(){
      if (this.treeNode.level===3){
        let positionName={
          zh:'',
          en:'',
          ru:'',
        }
        //到岗位名称列表中，找到这一行的内容，拼接为后端岗位Lis中的岗位记录信息
        let positListName = this.business_name.filter(item=>item.department_name===this.treeNode.data.departmentName && item.section_name===this.treeNode.data.sectionName && item.business_name===this.treeNode.data.businessName)
        if (positListName.length===1){
          positionName.zh=positListName[0].department_name.split('/')[0]+'/'+positListName[0].section_name.split('/')[0]+'/'+positListName[0].business_name.split('/')[0]
          positionName.en=positListName[0].department_name.split('/')[1]+'/'+positListName[0].section_name.split('/')[1]+'/'+positListName[0].business_name.split('/')[1]
          positionName.ru=positListName[0].department_name.split('/')[2]+'/'+positListName[0].section_name.split('/')[2]+'/'+positListName[0].business_name.split('/')[2]
        }
        return positionName
      }
      else {
        this.$message.error("非岗位层")
        return ''
      }
    },
    //辅助函数：向业务汇报的表中根据一个字段名，查询等于这个某一个值
    async inquiryBusinessReportOneFiled(filedName,filedVal){
      return this.$request.post('inquiryBusinessReportOneFiledJobDescription',{
        filedName:filedName,
        filedVal:filedVal
      }).then(result=>{
        if (result.code === 401) {
          this.$router.push('UserLogin')
          alert("您未登录，请登录")
        }
        //如果成功接收到数据
        else {
          return result.data
        }
      })
    },
    //辅助函数：向业务汇报的表中根据id，修改一行数据
    async editBusinessReportOneRow(val){
      return this.$request.post('/editBusinessReportOneRowJobDescription',val).then(result=>{
        if (result.code === 401) {
          this.$router.push('UserLogin')
          alert("您未登录，请登录")
        }
        //如果成功接收到数据
        else {
          return result.data
        }
      })
    },
    //辅助函数：读取岗位信息的辅助函数，调取的是所有的岗位信息
    async inquiryPostNameList(){
      let result =await this.$request.post('/inquiryPostNameListJobDescription')
      if (result.code === 401) {
        this.$router.push('UserLogin')
        alert("您未登录，请登录")
      }
      //如果成功接收到数据
      else {
        return result.data
      }
    },
    //辅助函数：读取业务汇报的明细,调动所有的
    async inquiryBusinessNameList(){
      let result =await this.$request.post('/inquiryBusinessNameListJobDescription')
      if (result.code === 401) {
        this.$router.push('UserLogin')
        alert("您未登录，请登录")
      }
      //如果成功接收到数据
      else {
        return result.data
      }
    },
  },
  mounted() {
    this.inquiry()
    //读取用户以前存放的语言
    const storedLang = localStorage.getItem('app_lang')
    if (storedLang==='zh'){
      this.languageS='chinese'
    }
    else if (storedLang==='en'){
      this.languageS='english'
    }
    else if (storedLang==='ru'){
      this.languageS='russian'
    }
    //数据清空
    this.tableDataForm={}
    this.tableData=[]
    this.taskListData=[]
    this.businessReportData=[]
    this.departmentTreeChinese=[]
    this.departmentTreeEnglish=[]
    this.departmentTreeRussian=[]
    //组合业务List的导航数据
    this.inquiryPostNameList().then(data=>{
      this.postListName=data
      //组合默认的中文的导航结构,第一步，筛选出部门
      const uniqueDepartments = [...new Set(data.map(item => item.department_name))]
      for (let i = 0; i < uniqueDepartments.length; i++) {
        //给中、英、俄的树形导航结构赋值
        this.departmentTreeChinese.push({label: uniqueDepartments[i].split('/')[0],children: []})
        this.departmentTreeEnglish.push({label: uniqueDepartments[i].split('/')[1],children: []})
        this.departmentTreeRussian.push({label: uniqueDepartments[i].split('/')[2],children: []})
        //筛选出这个部门下所有的数据
        let department = this.postListName.filter(item=>item.department_name===uniqueDepartments[i])
        //再筛选出的这个部门下，筛选出所有的不同科室
        const sectionNameList = [...new Set(department.map(item => item.section_name))]
        //对科室名称进行排序
        sectionNameList.sort((a,b)=>a -b)
        //在不同的科室下进行循环，插入到树形结构中
        for (let j = 0; j < sectionNameList.length; j++) {
          //把科室名称加入到三种语言的树形结构中
          this.departmentTreeChinese[i].children.push({label: sectionNameList[j].split('/')[0],children: []})
          this.departmentTreeEnglish[i].children.push({label: sectionNameList[j].split('/')[1],children: []})
          this.departmentTreeRussian[i].children.push({label: sectionNameList[j].split('/')[2],children: []})
          //筛选出不同科室下的岗位
          let section = department.filter(item=>item.section_name===sectionNameList[j])
          //对筛选出来的岗位名称进行排序
          section.sort((a,b)=>a.post_name.localeCompare(b.post_name))
          //循环，对不同岗位下信息插入到树形导航结构中
          for (let k = 0; k < section.length; k++) {
            this.departmentTreeChinese[i].children[j].children.push({label: section[k].post_name.split('/')[0],postName:section[k].post_name,sectionName:section[k].section_name,departmentName:section[k].department_name})
            this.departmentTreeEnglish[i].children[j].children.push({label: section[k].post_name.split('/')[1],postName:section[k].post_name,sectionName:section[k].section_name,departmentName:section[k].department_name})
            this.departmentTreeRussian[i].children[j].children.push({label: section[k].post_name.split('/')[2],postName:section[k].post_name,sectionName:section[k].section_name,departmentName:section[k].department_name})
          }
        }

      }
      this.departmentTree=this.departmentTreeChinese
    })
    //组合业务汇报的导航数据
    this.inquiryBusinessNameList().then(data=>{
      this.business_name=data
      this.businessTreeChinese=[]
      this.businessTreeEnglish=[]
      this.businessTreeRussian=[]
      //组合默认的中文的导航结构,第一步，筛选出部门
      const uniqueDepartments = [...new Set(data.map(item => item.department_name))]
      for (let i = 0; i < uniqueDepartments.length; i++) {
        //给中、英、俄的树形导航结构赋值
        this.businessTreeChinese.push({label: uniqueDepartments[i].split('/')[0],children: []})
        this.businessTreeEnglish.push({label: uniqueDepartments[i].split('/')[1],children: []})
        this.businessTreeRussian.push({label: uniqueDepartments[i].split('/')[2],children: []})
        //筛选出这个部门下所有的数据
        let department = this.business_name.filter(item=>item.department_name===uniqueDepartments[i])
        //再筛选出的这个部门下，筛选出所有的不同科室
        const sectionNameList = [...new Set(department.map(item => item.section_name))]
        //对科室名称进行排序
        sectionNameList.sort((a,b)=>a -b)
        //在不同的科室下进行循环，插入到树形结构中
        for (let j = 0; j < sectionNameList.length; j++) {
          //把科室名称加入到三种语言的树形结构中
          this.businessTreeChinese[i].children.push({label: sectionNameList[j].split('/')[0],children: []})
          this.businessTreeEnglish[i].children.push({label: sectionNameList[j].split('/')[1],children: []})
          this.businessTreeRussian[i].children.push({label: sectionNameList[j].split('/')[2],children: []})
          //筛选出不同科室下的岗位
          let section = department.filter(item=>item.section_name===sectionNameList[j])
          //对筛选出来的业务汇报名称进行排序
          section.sort((a,b)=>a.business_name.localeCompare(b.business_name))
          //循环，对不同岗位下信息插入到树形导航结构中
          for (let k = 0; k < section.length; k++) {
            this.businessTreeChinese[i].children[j].children.push({label: section[k].business_name.split('/')[0],businessName:section[k].business_name,sectionName:section[k].section_name,departmentName:section[k].department_name})
            this.businessTreeEnglish[i].children[j].children.push({label: section[k].business_name.split('/')[1],businessName:section[k].business_name,sectionName:section[k].section_name,departmentName:section[k].department_name})
            this.businessTreeRussian[i].children[j].children.push({label: section[k].business_name.split('/')[2],businessName:section[k].business_name,sectionName:section[k].section_name,departmentName:section[k].department_name})
          }
        }

      }
      this.departmentTree=this.departmentTreeChinese
    })
  },
  //组件销毁前的函数
  beforeDestroy() {
    // 组件销毁前，销毁 wangEditor 实例
    if (this.editor) {
      this.editor.destroy();
      this.editor = null;
    }
  },
}
</script>

<style scoped>
/* 主体左侧的工作步骤栏用到的数据包围的div的样式*/

.el-footer {
  background-color: #ffffff;
  color: #333;
  text-align: center;
  border-width: 3px; /* 设置边框宽度为3像素 */
  border-color: blue; /* 设置边框颜色为蓝色 */
  border-style: solid; /* 设置边框样式为实线 */
  padding: 10px; /* 添加内边距 */
  border-left-color: white;
  border-top: white;
}

.el-aside {
  background-color: #ffffff;
  color: #333;
  text-align: center;
  border-width: 3px; /* 设置边框宽度为3像素 */
  border-color: blue; /* 设置边框颜色为蓝色 */
  border-style: solid; /* 设置边框样式为实线 */
  padding: 10px; /* 添加内边距 */
  height: 89vh;
}

.el-main {
  color: #333;
  text-align: center;
  border-width: 3px; /* 设置边框宽度为3像素 */
  border-color: blue; /* 设置边框颜色为蓝色 */
  border-left-color: white;
  border-style: solid; /* 设置边框样式为实线 */
  padding: 10px; /* 添加内边距 */
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}

.headMain{
  color: #ffffff; /* 设置字体颜色为红色 */
  font-size: 18px;
}
.center-text {
  /* 使用 margin-left 和 margin-right auto 来实现居中效果 */
  margin-left: auto;
  margin-right: auto;
  /* 注意：如果 header 内只有这两个元素，你可能不需要 margin-right: auto */
}

/*自定义样式*/
/* 调整表单标签对齐方式 */
.el-form-item__label {
  padding: 0 12px 0 0;
  text-align: right;
}

/* 优化数字输入框样式 */
.el-input-number {
  width: 100%;
}
.el-input-number.is-controls-right .el-input__inner {
  padding-left: 15px;
  padding-right: 30px;
}

/* 上传图片的样式 */
.avatar-uploader :deep(.el-upload) {
  border: 1px dashed #d9d9d9 !important; /* 强制边框样式 */
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  width: 150px;  /* 强制保证容器尺寸 */
  height: 150px;
}

/* 增强悬停效果 */
.avatar-uploader :deep(.el-upload:hover) {
  border-color: #409EFF !important;
}

/* 防止全局蓝色边框继承 */
.avatar-uploader :deep(.el-upload) {
  border-top-color: #d9d9d9 !important;
  border-left-color: #d9d9d9 !important;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 150px;
  height: 150px;
  line-height: 150px;
  text-align: center;
}
.avatar {
  width: 150px;
  height: 150px;
  display: block;
}
</style>